summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/CSS2/bidi-text
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/css/CSS2/bidi-text
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/CSS2/bidi-text')
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-001-ref.xht42
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-001.xht35
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-002-ref.xht54
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-002.xht45
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-003-ref.xht65
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-003.xht48
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-004-ref.xht39
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-004.xht47
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-005a-ref.xht60
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-005a.xht34
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-005b-ref.xht40
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-005b.xht30
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-006a.xht34
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-006b.xht30
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-007a-ref.xht62
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-007a.xht33
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-007b-ref.xht41
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-007b.xht30
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-008a-ref.xht60
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-008a.xht33
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-008b-ref.xht40
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-008b.xht30
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-009a.xht37
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-009b.xht31
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-010a.xht36
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-010b.xht33
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-011-ref.xht40
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-011.xht28
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-alt-001.xht33
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-001-ref.xht31
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-001.xht36
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-002.xht36
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-003.xht36
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-004.xht36
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-005.xht36
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-006.xht36
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-007-ref.xht33
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-007.xht39
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-008.xht39
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-009.xht39
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-010-ref.xht32
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-010.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-011.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-012.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-013.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-014.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-015.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-016-ref.xht33
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-016.xht41
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-017.xht40
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-018.xht40
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-019-ref.xht32
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-019.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-020.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-021.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-022.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-023.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-024.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-025-ref.xht35
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-025.xht40
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-026.xht39
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-027.xht41
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-028.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-029.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-030.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-031.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-032.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-033.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-034-ref.xht32
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-034.xht42
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-035.xht41
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-036.xht41
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-037.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-038.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-039.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-040.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-041.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-042.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-043-ref.xht36
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-043.xht42
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-044.xht41
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-045.xht41
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-breaking-001-ref.xht103
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-breaking-001.xht100
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-breaking-002-ref.xht75
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-breaking-002.xht92
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-breaking-003-ref.xht87
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-breaking-003.xht94
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-glyph-mirroring-001-ref.xht26
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-glyph-mirroring-001.xht33
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-glyph-mirroring-002-ref.xht22
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-glyph-mirroring-002.xht30
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-inline-001-ref.xht22
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-inline-001.xht25
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/bidi-inline-002.xht29
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/direction-001-ref.xht24
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/direction-001.xht31
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/direction-002-ref.xht28
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/direction-002.xht25
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/direction-003.xht35
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-001-ref.xht31
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-001.xht61
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-002.xht61
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-003.xht61
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-004.xht54
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-005.xht49
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-006.xht49
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-007-ref.xht32
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-007.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-008-ref.xht20
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-008.xht26
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-009.xht33
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-010.xht33
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-012.xht33
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-013.xht51
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-014.xht51
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-015.xht48
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/line-breaking-bidi-001-ref.xht36
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/line-breaking-bidi-001.xht38
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/line-breaking-bidi-002-ref.xht36
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/line-breaking-bidi-002.xht38
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/line-breaking-bidi-003-ref.xht31
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/line-breaking-bidi-003.xht36
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/1x1-green.pngbin0 -> 135 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/1x1-lime.pngbin0 -> 135 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/1x1-maroon.pngbin0 -> 109 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/1x1-navy.pngbin0 -> 109 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/1x1-red.pngbin0 -> 135 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/1x1-white.pngbin0 -> 109 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/60x60-gg-rr.pngbin0 -> 224 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/60x60-green.pngbin0 -> 218 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/a-green.css1
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/b-green.css1
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/black15x15.pngbin0 -> 168 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/blue15x15.pngbin0 -> 185 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/c-red.css1
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/cat.pngbin0 -> 1883 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/diamond.pngbin0 -> 188 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/green15x15.pngbin0 -> 170 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/pattern-grg-rgr-grg.pngbin0 -> 222 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/pattern-grg-rrg-rgg.pngbin0 -> 231 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/pattern-rgr-grg-rgr.pngbin0 -> 223 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/pattern-tr.pngbin0 -> 137 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/ring.pngbin0 -> 715 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/square-purple.pngbin0 -> 92 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/square-teal.pngbin0 -> 92 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/square-white.pngbin0 -> 78 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-blue.pngbin0 -> 84 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-green.pngbin0 -> 84 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-lime.pngbin0 -> 84 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-orange.pngbin0 -> 84 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-red.pngbin0 -> 84 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-teal.pngbin0 -> 156 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-white.pngbin0 -> 85 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-yellow.pngbin0 -> 84 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/test-bl.pngbin0 -> 1368 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/test-br.pngbin0 -> 1045 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/test-outer.pngbin0 -> 2412 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/test-tl.pngbin0 -> 1025 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/support/test-tr.pngbin0 -> 1235 bytes
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-001.xht26
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-002-ref.xht28
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-002.xht29
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-003.xht26
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-004.xht32
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-001.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-002.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-003.xht44
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-004.xht38
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-005.xht43
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-006.xht43
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-007.xht38
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-008.xht26
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-009-ref.xht24
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-009.xht28
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-010.xht28
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-012.xht26
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-013.xht38
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-014.xht38
-rw-r--r--testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-015.xht43
180 files changed, 5834 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-001-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-001-ref.xht
new file mode 100644
index 0000000000..099ceedeef
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-001-ref.xht
@@ -0,0 +1,42 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+ <title>CSS Reftest Reference</title>
+
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ span
+ {
+ color: blue;
+ line-height: 3em;
+ }
+
+ span.top-left-bottom
+ {
+ border-style: solid none solid solid;
+ padding: 0.4em 0 0.4em 1em;
+ }
+
+ span.top-right-bottom
+ {
+ border-style: solid solid solid none;
+ padding: 0.4em 1em 0.4em 0;
+ }
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>The following two lines should be identical. (Force bidi: &#x05D0;)</p>
+
+ <p><span class="top-left-bottom">AAABBBCCC</span>DDDEEEFFF<span class="top-right-bottom">GGGHHHIII</span>JJJKKKLLL</p>
+
+ <p><span class="top-left-bottom">AAABBBCCC</span>DDDEEEFFF<span class="top-right-bottom">GGGHHHIII</span>JJJKKKLLL</p>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-001.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-001.xht
new file mode 100644
index 0000000000..57d630ea78
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-001.xht
@@ -0,0 +1,35 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+ <head>
+
+ <title>CSS Test: RLO/PDF bidi reordering across closing inline element boundary</title>
+ <meta name="assert"
+ content="Tests that RLO + closing inline element boundary + PDF
+ reorders text, splitting inline and rendering borders and padding appropriately."/>
+ <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/inline/bidi/001.html" type="text/html"/>
+
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-control-codes"/>
+
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#white-space-model"/>
+ <link rel="help" href="http://unicode.org/reports/tr9/"/>
+
+ <link rel="match" href="bidi-001-ref.xht" />
+
+ <style type="text/css">
+ .test { border: solid; padding: 0.4em 1em; line-height: 3em; color: blue; }
+ .control { line-height: 3em; color: blue; }
+ .control.a { border-style: solid none solid solid; padding: 0.4em 0 0.4em 1em; }
+ .control.b { border-style: solid solid solid none; padding: 0.4em 1em 0.4em 0; }
+ </style>
+ </head>
+ <body>
+ <p> The following two lines should be identical. (Force bidi: &#x05D0;) </p>
+ <p> <span class="control a">AAABBBCCC</span>DDDEEEFFF<span class="control b">GGGHHHIII</span>JJJKKKLLL </p>
+ <p> <span class="test"> AAABBBCCC&#x202E;IIIHHHGGG</span>FFFEEEDDD&#x202C;JJJKKKLLL </p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-002-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-002-ref.xht
new file mode 100644
index 0000000000..831cdee909
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-002-ref.xht
@@ -0,0 +1,54 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+
+ <title>CSS Reftest Reference</title>
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ div > p
+ {
+ background-color: #FFC;
+ border: solid;
+ color: black;
+ margin: 1em;
+ padding: 0.5em;
+ width: 17em;
+ }
+
+ span
+ {
+ color: navy;
+ line-height: 3em;
+ }
+
+ span.top-left-bottom
+ {
+ border-style: solid none solid solid;
+ padding: 0.4em 0 0.4em 1em;
+ }
+
+ span.top-right-bottom
+ {
+ border-style: solid solid solid none;
+ padding: 0.4em 1em 0.4em 0;
+ }
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>The following two blocks should be identical, including overflow. (Force bidi: &#x05D0;)</p>
+
+ <div>
+ <p><span class="top-left-bottom">AAABBBCCC</span>DDDEEEFFF<span class="top-right-bottom">GGGHHHIII</span> JJJKKKLLLMMMNNNOOO</p>
+
+ <p><span class="top-left-bottom">AAABBBCCC</span>DDDEEEFFF<span class="top-right-bottom">GGGHHHIII</span> JJJKKKLLLMMMNNNOOO</p>
+ </div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-002.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-002.xht
new file mode 100644
index 0000000000..518a55958e
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-002.xht
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+ <head>
+
+ <title>CSS Test: RLO/PDF bidi reordering across closing inline element boundary + soft line break</title>
+ <meta name="assert"
+ content="Tests that RLO + closing inline element boundary + soft line break + PDF
+ reorders text, placing text correctly on each line
+ while also splitting inline and rendering borders and padding appropriately."/>
+ <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
+ <link rel="reviewer" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+ <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/inline/bidi/002.html" type="text/html"/>
+
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-control-codes"/>
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-processing"/>
+
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction"/>
+ <link rel="help" href="http://unicode.org/reports/tr9/"/>
+
+ <link rel="match" href="bidi-002-ref.xht" />
+
+ <style type="text/css">
+ div p { width: 17em; border: solid; margin: 1em; padding: 0.5em; background: #FFFFCC; color: black; }
+ .test { border: solid; padding: 0.4em 1em; line-height: 3em; color: navy; }
+ .control { line-height: 3em; color: navy; }
+ .control.a { border-style: solid none solid solid; padding: 0.4em 0 0.4em 1em; }
+ .control.b { border-style: solid solid solid none; padding: 0.4em 1em 0.4em 0; }
+ </style>
+ </head>
+ <body>
+ <p> The following two blocks should be identical, including overflow. (Force bidi: &#x05D0;) </p>
+ <div>
+ <p>
+ <span class="control a">AAABBBCCC</span>DDDEEEFFF<span class="control b">GGGHHHIII</span>
+ JJJKKKLLLMMMNNNOOO
+ </p>
+ <p>
+ <span class="test">AAABBBCCC&#x202E;IIIHHHGGG</span>FFFEEEDDD
+ LLLKKKJJJ&#x202C;MMMNNNOOO
+ </p>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-003-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-003-ref.xht
new file mode 100644
index 0000000000..6e4d51a4fa
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-003-ref.xht
@@ -0,0 +1,65 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+
+ <title>CSS Reftest Reference</title>
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ div > p
+ {
+ background-color: #FFC;
+ border: solid;
+ margin: 1em;
+ padding: 0.5em;
+ white-space: nowrap;
+ }
+
+ span {line-height: 3em;}
+
+ span.top-left-bottom
+ {
+ border-style: solid none solid solid;
+ padding: 0.4em 0 0.4em 1em;
+ }
+
+ .navy {color: navy;}
+
+ .orange {color: orange;}
+
+ span.top-right-bottom
+ {
+ border-style: solid solid solid none;
+ padding: 0.4em 1em 0.4em 0;
+ }
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>The following two blocks should be identical, including overflow. (Force bidi: &#x05D0;)</p>
+
+ <div>
+ <p>
+ <span class="top-left-bottom navy"> aaa bbb ccc </span>
+ <span class="top-left-bottom orange"> ddd eee fff </span>
+ ggg hhh iii
+ <span class="top-right-bottom navy"> jjj kkk lll </span>
+ <span class="top-right-bottom orange"> mmm nnn ooo </span>
+ </p>
+
+ <p>
+ <span class="top-left-bottom navy"> aaa bbb ccc </span>
+ <span class="top-left-bottom orange"> ddd eee fff </span>
+ ggg hhh iii
+ <span class="top-right-bottom navy"> jjj kkk lll </span>
+ <span class="top-right-bottom orange"> mmm nnn ooo </span>
+ </p>
+ </div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-003.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-003.xht
new file mode 100644
index 0000000000..22b3207014
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-003.xht
@@ -0,0 +1,48 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+ <head>
+
+ <title>CSS Test: RLO/PDF bidi reordering across closing inline element boundary + opening inline boundary</title>
+ <meta name="assert"
+ content="Tests that RLO + closing inline element boundary + opening inline element boundary + PDF
+ reorders text, splitting inlines and rendering their borders and padding appropriately."/>
+ <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
+ <link rel="reviewer" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+ <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/inline/bidi/003.html" type="text/html"/>
+
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-control-codes"/>
+
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#white-space-model"/>
+ <link rel="help" href="http://unicode.org/reports/tr9/"/>
+
+ <link rel="match" href="bidi-003-ref.xht" />
+
+ <style type="text/css">
+ div p { white-space: nowrap; border: solid; margin: 1em; padding: 0.5em; background: #FFFFCC; color: black; }
+ .test { border: solid; padding: 0.4em 1em; line-height: 3em; }
+ .control { line-height: 3em; }
+ .control.start { border-style: solid none solid solid; padding: 0.4em 0 0.4em 1em; }
+ .control.end { border-style: solid solid solid none; padding: 0.4em 1em 0.4em 0; }
+ .a { color: navy; }
+ .b { color: orange; }
+ </style>
+ </head>
+ <body>
+ <p> The following two blocks should be identical, including overflow. (Force bidi: &#x05D0;) </p>
+ <div>
+ <p>
+ <span class="control a start"> aaa bbb ccc </span>
+ <span class="control b start"> ddd eee fff </span>
+ ggg hhh iii
+ <span class="control a end"> jjj kkk lll </span>
+ <span class="control b end"> mmm nnn ooo </span>
+ </p>
+ <p>
+ <span class="test a"> aaa bbb ccc &#x202E; lll kkk jjj </span> iii hhh ggg <span class="test b"> fff eee ddd &#x202C; mmm nnn ooo </span>
+ </p>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-004-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-004-ref.xht
new file mode 100644
index 0000000000..b8bb0563b2
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-004-ref.xht
@@ -0,0 +1,39 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+ <title>CSS Reftest Reference</title>
+
+ <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact" />
+ <meta name="flags" content="ahem"/>
+
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css">
+ div p { width: 28em; border: solid; margin: 1em; padding: 0.5em; background: #FFFFCC; color: black; font: 1em/1 Ahem; }
+ .control { line-height: 3em; }
+ .control.start { border-style: solid none solid solid; padding: 0.4em 0 0.4em 1em; }
+ .control.middle { border-style: solid none solid none; padding: 0.4em 0 0.4em 0; }
+ .control.end { border-style: solid solid solid none; padding: 0.4em 1em 0.4em 0; }
+ .a { color: navy; }
+ .b { color: orange; }
+ </style>
+ </head>
+ <body>
+ <p> The following two blocks should be identical, including overflow. (Force bidi: &#x05D0;) </p>
+ <div>
+ <p>
+ <span class="control a start">pppp&nbsp;pppX&nbsp;ppXp&nbsp;ppXX&nbsp;pXpp</span><br
+ /><span class="control b start">pXpX</span>&nbsp;pXXp&nbsp;pXXX&nbsp;Xppp<span class="control a end">&nbsp;XppX</span><br
+ /><span class="control b end">XpXp&nbsp;XpXX&nbsp;XXpp&nbsp;XXpX&nbsp;XXXp</span>
+ </p>
+ <p>
+ <span class="control a start">pppp&nbsp;pppX&nbsp;ppXp&nbsp;ppXX&nbsp;pXpp</span><br
+ /><span class="control b start">pXpX</span>&nbsp;pXXp&nbsp;pXXX&nbsp;Xppp<span class="control a end">&nbsp;XppX</span><br
+ /><span class="control b end">XpXp&nbsp;XpXX&nbsp;XXpp&nbsp;XXpX&nbsp;XXXp</span>
+ </p>
+ </div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-004.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-004.xht
new file mode 100644
index 0000000000..3ebd0eb146
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-004.xht
@@ -0,0 +1,47 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+ <head>
+ <title>CSS Test: The bidi algorithm and inlines in CSS</title>
+ <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
+ <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/inline/bidi/004.html" type="text/html"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/css-text-3/#white-space-rules"/>
+ <!-- Spaces are collapsed, then reordered, then trimmed. -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-control-codes"/>
+
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#white-space-model"/>
+ <link rel="help" href="http://unicode.org/reports/tr9/"/>
+ <link rel="help" href="http://www.w3.org/TR/html5/rendering.html#phrasing-content-0"/> <!-- <br> is a bidi paragraph separator -->
+ <link rel="match" href="bidi-004-ref.xht" />
+
+ <meta name="flags" content="may21 ahem"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css">
+ div p { width: 28em; border: solid; margin: 1em; padding: 0.5em; background: #FFFFCC; color: black; font: 1em/1 Ahem; }
+ .test { border: solid; padding: 0.4em 1em; line-height: 3em; }
+ .control { line-height: 3em; }
+ .control.start { border-style: solid none solid solid; padding: 0.4em 0 0.4em 1em; }
+ .control.middle { border-style: solid none solid none; padding: 0.4em 0 0.4em 0; }
+ .control.end { border-style: solid solid solid none; padding: 0.4em 1em 0.4em 0; }
+ .a { color: navy; }
+ .b { color: orange; }
+ </style>
+ </head>
+ <body>
+ <p> The following two blocks should be identical, including overflow. (Force bidi: &#x05D0;) </p>
+ <div>
+ <p>
+ <span class="control a start">pppp&nbsp;pppX&nbsp;ppXp&nbsp;ppXX&nbsp;pXpp</span><br
+ /><span class="control b start">pXpX</span>&nbsp;pXXp&nbsp;pXXX&nbsp;Xppp<span class="control a end">&nbsp;XppX</span><br
+ /><span class="control b end">XpXp&nbsp;XpXX&nbsp;XXpp&nbsp;XXpX&nbsp;XXXp</span>
+ </p>
+ <p>
+ <!-- (note that everything between the RLO to the PDF is backwards) -->
+ <!-- line 1...................--> <!-- line 2........................................--> <!-- line 3...................-->
+ <span class="test a"> pppp pppX ppXp &#x202E; ppXp XXpp XppX </span> pppX XXXp pXXp <span class="test b"> XpXp ppXX XXpX pXpX &#x202C; XXpX XXXp </span>
+ </p>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-005a-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-005a-ref.xht
new file mode 100644
index 0000000000..a094282ac1
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-005a-ref.xht
@@ -0,0 +1,60 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+
+ <title>CSS Reftest Reference</title>
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ div > p
+ {
+ background-color: black;
+ color: yellow;
+ font: 2em/1 serif;
+ margin: 1em;
+ padding: 0.75em;
+ white-space: pre;
+ }
+
+ .c, .j, .e {color: aqua;}
+
+ .b, .d, .i, .k {color: fuchsia;}
+
+ .b, .c
+ {
+ border-style: solid none solid solid;
+ padding: 0.1em 0 0.1em 0;
+ margin-left: 0.5em;
+ }
+
+ .j, .k
+ {
+ border-style: solid solid solid none;
+ padding: 0.1em 0 0.1em 0;
+ margin-right: 0.5em;
+ }
+
+ .d, .e, .i
+ {
+ border-style: solid none solid none;
+ padding: 0.1em 0 0.1em 0;
+ }
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>The following two blocks should be identical, including overflow. (Force bidi: &#x05D0;)</p>
+
+ <div>
+ <p>a<span class="b">b</span><span class="c">c</span><span class="d">d</span><span class="e">e</span>fgh<span class="i">i</span><span class="j">j</span><span class="k">k</span>lm</p>
+
+ <p>a<span class="b">b</span><span class="c">c</span><span class="d">d</span><span class="e">e</span>fgh<span class="i">i</span><span class="j">j</span><span class="k">k</span>lm</p>
+ </div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-005a.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-005a.xht
new file mode 100644
index 0000000000..c6bf5d2558
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-005a.xht
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+ <head>
+
+ <title>CSS Test: The bidi algorithm and inlines in CSS: embed levels and white-space: pre; </title>
+ <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-01 -->
+ <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/inline/bidi/005.html" type="text/html"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-control-codes"/>
+ <link rel="help" href="http://www.w3.org/TR/css-text-3/#letter-spacing-property"/>
+ <link rel="help" href="http://unicode.org/reports/tr9/"/>
+ <link rel="match" href="bidi-005a-ref.xht" />
+
+ <style type="text/css">
+ div p { white-space: pre; margin: 1em; padding: 0.75em; background: black; color: yellow; font: 2em/1 serif; }
+ .one, .c, .j, .e { color: aqua; }
+ .two, .i, .d, .k, .b { color: fuchsia; }
+ .one, .two { border: solid; padding: 0.1em 0 0.1em 0; margin: 0 0.5em 0 0.5em; }
+ .c, .b { border-style: solid none solid solid; padding: 0.1em 0 0.1em 0; margin: 0 0 0 0.5em; }
+ .j, .k { border-style: solid solid solid none; padding: 0.1em 0 0.1em 0; margin: 0 0.5em 0 0; }
+ .e, .i, .d { border-style: solid none solid none; padding: 0.1em 0 0.1em 0; margin: 0 0 0 0; }
+ </style>
+ </head>
+ <body>
+ <p> The following two blocks should be identical, including overflow. (Force bidi: &#x05D0;) </p>
+ <div>
+ <p class="reference"><span class="a">a</span><span class="b">b</span><span class="c">c</span><span class="d">d</span><span class="e">e</span><span class="f">f</span><span class="g">g</span><span class="h">h</span><span class="i">i</span><span class="j">j</span><span class="k">k</span><span class="l">l</span><span class="m">m</span></p>
+ <p class="test">a&#x202E;l&#x202D;<span class="one">c&#x202E;j&#x202D;e&#x202E;</span>h&#x202D;g&#x202C;f<span class="two">&#x202C;i&#x202C;d&#x202C;k&#x202C;b</span>&#x202C;m</p>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-005b-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-005b-ref.xht
new file mode 100644
index 0000000000..19338a981f
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-005b-ref.xht
@@ -0,0 +1,40 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+
+ <title>CSS Reftest Reference</title>
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ div > p
+ {
+ background-color: black;
+ color: yellow;
+ font: 2em/1 serif;
+ letter-spacing: 1em;
+ margin: 1em;
+ padding: 0.75em;
+ white-space: pre;
+ }
+
+ .c, .j, .e {color: aqua;}
+
+ .i, .d, .k, .b {color: fuchsia;}
+ ]]></style>
+ </head>
+
+ <body>
+
+ <p>The following two blocks should be identical, including overflow. (Force bidi: &#x05D0;)</p>
+
+ <div>
+ <p>a<span class="b">b</span><span class="c">c</span><span class="d">d</span><span class="e">e</span>fgh<span class="i">i</span><span class="j">j</span><span class="k">k</span>lm</p>
+
+ <p>a<span class="b">b</span><span class="c">c</span><span class="d">d</span><span class="e">e</span>fgh<span class="i">i</span><span class="j">j</span><span class="k">k</span>lm</p>
+ </div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-005b.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-005b.xht
new file mode 100644
index 0000000000..39cdab5ee2
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-005b.xht
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+ <head>
+
+ <title>CSS Test: The bidi algorithm and inlines in CSS: embed levels and white-space: pre; </title>
+ <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-01 -->
+ <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/inline/bidi/005.html" type="text/html"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction"/>
+ <link rel="help" href="http://unicode.org/reports/tr9/"/>
+ <link rel="help" href="http://www.w3.org/TR/css-text-3/#letter-spacing-property"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-control-codes"/>
+ <link rel="match" href="bidi-005b-ref.xht" />
+
+ <style type="text/css">
+ div p { white-space: pre; margin: 1em; padding: 0.75em; background: black; color: yellow; font: 2em/1 serif; letter-spacing: 1em; }
+ .one, .c, .j, .e { color: aqua; }
+ .two, .i, .d, .k, .b { color: fuchsia; }
+ </style>
+ </head>
+ <body>
+ <p> The following two blocks should be identical, including overflow. (Force bidi: &#x05D0;) </p>
+ <div>
+ <p class="reference"><span class="a">a</span><span class="b">b</span><span class="c">c</span><span class="d">d</span><span class="e">e</span><span class="f">f</span><span class="g">g</span><span class="h">h</span><span class="i">i</span><span class="j">j</span><span class="k">k</span><span class="l">l</span><span class="m">m</span></p>
+ <p class="test">a&#x202E;l&#x202D;<span class="one">c&#x202E;j&#x202D;e&#x202E;</span>h&#x202D;g&#x202C;f<span class="two">&#x202C;i&#x202C;d&#x202C;k&#x202C;b</span>&#x202C;m</p>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-006a.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-006a.xht
new file mode 100644
index 0000000000..a12eb99d9c
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-006a.xht
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+ <head>
+
+ <title>CSS Test: The bidi algorithm and inlines in CSS: embed levels and white-space: nowrap; </title>
+ <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-01 -->
+ <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/inline/bidi/006.html" type="text/html"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-control-codes"/>
+ <link rel="help" href="http://www.w3.org/TR/css-text-3/#letter-spacing-property"/>
+ <link rel="help" href="http://unicode.org/reports/tr9/"/>
+ <link rel="match" href="bidi-005a-ref.xht" />
+
+ <style type="text/css">
+ div p { white-space: nowrap; margin: 1em; padding: 0.75em; background: black; color: yellow; font: 2em/1 serif; }
+ .one, .c, .j, .e { color: aqua; }
+ .two, .i, .d, .k, .b { color: fuchsia; }
+ .one, .two { border: solid; padding: 0.1em 0 0.1em 0; margin: 0 0.5em 0 0.5em; }
+ .c, .b { border-style: solid none solid solid; padding: 0.1em 0 0.1em 0; margin: 0 0 0 0.5em; }
+ .j, .k { border-style: solid solid solid none; padding: 0.1em 0 0.1em 0; margin: 0 0.5em 0 0; }
+ .e, .i, .d { border-style: solid none solid none; padding: 0.1em 0 0.1em 0; margin: 0 0 0 0; }
+ </style>
+ </head>
+ <body>
+ <p> The following two blocks should be identical, including overflow. (Force bidi: &#x05D0;) </p>
+ <div>
+ <p class="reference"><span class="a">a</span><span class="b">b</span><span class="c">c</span><span class="d">d</span><span class="e">e</span><span class="f">f</span><span class="g">g</span><span class="h">h</span><span class="i">i</span><span class="j">j</span><span class="k">k</span><span class="l">l</span><span class="m">m</span></p>
+ <p class="test">a&#x202E;l&#x202D;<span class="one">c&#x202E;j&#x202D;e&#x202E;</span>h&#x202D;g&#x202C;f<span class="two">&#x202C;i&#x202C;d&#x202C;k&#x202C;b</span>&#x202C;m</p>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-006b.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-006b.xht
new file mode 100644
index 0000000000..7645ff0f0d
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-006b.xht
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+ <head>
+
+ <title>CSS Test: The bidi algorithm and inlines in CSS: embed levels and white-space: nowrap; </title>
+ <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-01 -->
+ <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/inline/bidi/006.html" type="text/html"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction"/>
+ <link rel="help" href="http://www.w3.org/TR/css-text-3/#letter-spacing-property"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-control-codes"/>
+ <link rel="help" href="http://unicode.org/reports/tr9/"/>
+ <link rel="match" href="bidi-005b-ref.xht" />
+
+ <style type="text/css">
+ div p { white-space: nowrap; margin: 1em; padding: 0.75em; background: black; color: yellow; font: 2em/1 serif; letter-spacing: 1em; }
+ .one, .c, .j, .e { color: aqua; }
+ .two, .i, .d, .k, .b { color: fuchsia; }
+ </style>
+ </head>
+ <body>
+ <p> The following two blocks should be identical, including overflow. (Force bidi: &#x05D0;) </p>
+ <div>
+ <p class="reference"><span class="a">a</span><span class="b">b</span><span class="c">c</span><span class="d">d</span><span class="e">e</span><span class="f">f</span><span class="g">g</span><span class="h">h</span><span class="i">i</span><span class="j">j</span><span class="k">k</span><span class="l">l</span><span class="m">m</span></p>
+ <p class="test">a&#x202E;l&#x202D;<span class="one">c&#x202E;j&#x202D;e&#x202E;</span>h&#x202D;g&#x202C;f<span class="two">&#x202C;i&#x202C;d&#x202C;k&#x202C;b</span>&#x202C;m</p>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-007a-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-007a-ref.xht
new file mode 100644
index 0000000000..5c5e167da3
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-007a-ref.xht
@@ -0,0 +1,62 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+
+ <title>CSS Reftest Reference</title>
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ div > p
+ {
+ background-color: black;
+ clear: left;
+ color: yellow;
+ float: left;
+ font: 2em/1 serif;
+ margin: 0.5em 1em;
+ padding: 0.75em;
+ white-space: pre;
+ }
+
+ .c, .j, .e {color: aqua;}
+
+ .b, .d, .i, .k {color: fuchsia;}
+
+ .b, .c
+ {
+ border-style: solid none solid solid;
+ padding: 0.1em 0 0.1em 0;
+ margin-left: 0.5em;
+ }
+
+ .j, .k
+ {
+ border-style: solid solid solid none;
+ padding: 0.1em 0 0.1em 0;
+ margin-right: 0.5em;
+ }
+
+ .d, .e, .i
+ {
+ border-style: solid none solid none;
+ padding: 0.1em 0 0.1em 0;
+ }
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>The following two blocks should be identical, including overflow. (Force bidi: &#x05D0;)</p>
+
+ <div>
+ <p>a<span class="b">b</span><span class="c">c</span><span class="d">d</span><span class="e">e</span>fgh<span class="i">i</span><span class="j">j</span><span class="k">k</span>lm</p>
+
+ <p>a<span class="b">b</span><span class="c">c</span><span class="d">d</span><span class="e">e</span>fgh<span class="i">i</span><span class="j">j</span><span class="k">k</span>lm</p>
+ </div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-007a.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-007a.xht
new file mode 100644
index 0000000000..f09e90ba28
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-007a.xht
@@ -0,0 +1,33 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+ <head>
+
+ <title>CSS Test: The bidi algorithm and inlines in CSS: embed levels and float: left; </title>
+ <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-01 -->
+ <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/inline/bidi/007.html" type="text/html"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-control-codes"/>
+ <link rel="help" href="http://unicode.org/reports/tr9/"/>
+ <link rel="match" href="bidi-007a-ref.xht" />
+
+ <style type="text/css">
+ div p { float: left; clear: left; margin: 0.5em 1em; padding: 0.75em; background: black; color: yellow; font: 2em/1 serif; }
+ .one, .c, .j, .e { color: aqua; }
+ .two, .i, .d, .k, .b { color: fuchsia; }
+ .one, .two { border: solid; padding: 0.1em 0 0.1em 0; margin: 0 0.5em 0 0.5em; }
+ .c, .b { border-style: solid none solid solid; padding: 0.1em 0 0.1em 0; margin: 0 0 0 0.5em; }
+ .j, .k { border-style: solid solid solid none; padding: 0.1em 0 0.1em 0; margin: 0 0.5em 0 0; }
+ .e, .i, .d { border-style: solid none solid none; padding: 0.1em 0 0.1em 0; margin: 0 0 0 0; }
+ </style>
+ </head>
+ <body>
+ <p> The following two blocks should be identical, including overflow. (Force bidi: &#x05D0;) </p>
+ <div>
+ <p class="reference"><span class="a">a</span><span class="b">b</span><span class="c">c</span><span class="d">d</span><span class="e">e</span><span class="f">f</span><span class="g">g</span><span class="h">h</span><span class="i">i</span><span class="j">j</span><span class="k">k</span><span class="l">l</span><span class="m">m</span></p>
+ <p class="test">a&#x202E;l&#x202D;<span class="one">c&#x202E;j&#x202D;e&#x202E;</span>h&#x202D;g&#x202C;f<span class="two">&#x202C;i&#x202C;d&#x202C;k&#x202C;b</span>&#x202C;m</p>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-007b-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-007b-ref.xht
new file mode 100644
index 0000000000..c588b08af9
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-007b-ref.xht
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+
+ <title>CSS Reftest Reference</title>
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ div > p
+ {
+ background-color: black;
+ clear: left;
+ color: yellow;
+ float: left;
+ font: 2em/1 serif;
+ letter-spacing: 1em;
+ margin: 0.5em 1em;
+ padding: 0.75em;
+ }
+
+ .c, .j, .e {color: aqua;}
+
+ .i, .d, .k, .b {color: fuchsia;}
+ ]]></style>
+ </head>
+
+ <body>
+
+ <p>The following two blocks should be identical, including overflow. (Force bidi: &#x05D0;)</p>
+
+ <div>
+ <p>a<span class="b">b</span><span class="c">c</span><span class="d">d</span><span class="e">e</span>fgh<span class="i">i</span><span class="j">j</span><span class="k">k</span>lm</p>
+
+ <p>a<span class="b">b</span><span class="c">c</span><span class="d">d</span><span class="e">e</span>fgh<span class="i">i</span><span class="j">j</span><span class="k">k</span>lm</p>
+ </div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-007b.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-007b.xht
new file mode 100644
index 0000000000..17de94046f
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-007b.xht
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+ <head>
+
+ <title>CSS Test: The bidi algorithm and inlines in CSS: embed levels and float: left; </title>
+ <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-01 -->
+ <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/inline/bidi/007.html" type="text/html"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction"/>
+ <link rel="help" href="http://www.w3.org/TR/css-text-3/#letter-spacing-property"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-control-codes"/>
+ <link rel="help" href="http://unicode.org/reports/tr9/"/>
+ <link rel="match" href="bidi-007b-ref.xht" />
+
+ <style type="text/css">
+ div p { float: left; clear: left; margin: 0.5em 1em; padding: 0.75em; background: black; color: yellow; font: 2em/1 serif; letter-spacing: 1em; }
+ .one, .c, .j, .e { color: aqua; }
+ .two, .i, .d, .k, .b { color: fuchsia; }
+ </style>
+ </head>
+ <body>
+ <p> The following two blocks should be identical, including overflow. (Force bidi: &#x05D0;) </p>
+ <div>
+ <p class="reference"><span class="a">a</span><span class="b">b</span><span class="c">c</span><span class="d">d</span><span class="e">e</span><span class="f">f</span><span class="g">g</span><span class="h">h</span><span class="i">i</span><span class="j">j</span><span class="k">k</span><span class="l">l</span><span class="m">m</span></p>
+ <p class="test">a&#x202E;l&#x202D;<span class="one">c&#x202E;j&#x202D;e&#x202E;</span>h&#x202D;g&#x202C;f<span class="two">&#x202C;i&#x202C;d&#x202C;k&#x202C;b</span>&#x202C;m</p>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-008a-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-008a-ref.xht
new file mode 100644
index 0000000000..7feeed9443
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-008a-ref.xht
@@ -0,0 +1,60 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+
+ <title>CSS Reftest Reference</title>
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ div > p
+ {
+ background-color: black;
+ color: yellow;
+ display: table;
+ font: 2em/1 serif;
+ margin: 1em;
+ padding: 0.75em;
+ }
+
+ .c, .j, .e {color: aqua;}
+
+ .b, .d, .i, .k {color: fuchsia;}
+
+ .b, .c
+ {
+ border-style: solid none solid solid;
+ padding: 0.1em 0 0.1em 0;
+ margin-left: 0.5em;
+ }
+
+ .j, .k
+ {
+ border-style: solid solid solid none;
+ padding: 0.1em 0 0.1em 0;
+ margin-right: 0.5em;
+ }
+
+ .d, .e, .i
+ {
+ border-style: solid none solid none;
+ padding: 0.1em 0 0.1em 0;
+ }
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>The following two blocks should be identical, including overflow. (Force bidi: &#x05D0;)</p>
+
+ <div>
+ <p>a<span class="b">b</span><span class="c">c</span><span class="d">d</span><span class="e">e</span>fgh<span class="i">i</span><span class="j">j</span><span class="k">k</span>lm</p>
+
+ <p>a<span class="b">b</span><span class="c">c</span><span class="d">d</span><span class="e">e</span>fgh<span class="i">i</span><span class="j">j</span><span class="k">k</span>lm</p>
+ </div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-008a.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-008a.xht
new file mode 100644
index 0000000000..b433001352
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-008a.xht
@@ -0,0 +1,33 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+ <head>
+
+ <title>CSS Test: The bidi algorithm and inlines in CSS: embed levels and display: table; </title>
+ <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-01 -->
+ <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/inline/bidi/008.html" type="text/html"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-control-codes"/>
+ <link rel="help" href="http://unicode.org/reports/tr9/"/>
+ <link rel="match" href="bidi-008a-ref.xht" />
+
+ <style type="text/css">
+ div p { display: table; margin: 1em; padding: 0.75em; background: black; color: yellow; font: 2em/1 serif; }
+ .one, .c, .j, .e { color: aqua; }
+ .two, .i, .d, .k, .b { color: fuchsia; }
+ .one, .two { border: solid; padding: 0.1em 0 0.1em 0; margin: 0 0.5em 0 0.5em; }
+ .c, .b { border-style: solid none solid solid; padding: 0.1em 0 0.1em 0; margin: 0 0 0 0.5em; }
+ .j, .k { border-style: solid solid solid none; padding: 0.1em 0 0.1em 0; margin: 0 0.5em 0 0; }
+ .e, .i, .d { border-style: solid none solid none; padding: 0.1em 0 0.1em 0; margin: 0 0 0 0; }
+ </style>
+ </head>
+ <body>
+ <p> The following two blocks should be identical, including overflow. (Force bidi: &#x05D0;) </p>
+ <div>
+ <p class="reference"><span class="a">a</span><span class="b">b</span><span class="c">c</span><span class="d">d</span><span class="e">e</span><span class="f">f</span><span class="g">g</span><span class="h">h</span><span class="i">i</span><span class="j">j</span><span class="k">k</span><span class="l">l</span><span class="m">m</span></p>
+ <p class="test">a&#x202E;l&#x202D;<span class="one">c&#x202E;j&#x202D;e&#x202E;</span>h&#x202D;g&#x202C;f<span class="two">&#x202C;i&#x202C;d&#x202C;k&#x202C;b</span>&#x202C;m</p>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-008b-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-008b-ref.xht
new file mode 100644
index 0000000000..4995432864
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-008b-ref.xht
@@ -0,0 +1,40 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+
+ <title>CSS Reftest Reference</title>
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ div > p
+ {
+ background-color: black;
+ color: yellow;
+ display: table;
+ font: 2em/1 serif;
+ letter-spacing: 1em;
+ margin: 1em;
+ padding: 0.75em;
+ }
+
+ .c, .j, .e {color: aqua;}
+
+ .i, .d, .k, .b {color: fuchsia;}
+ ]]></style>
+ </head>
+
+ <body>
+
+ <p>The following two blocks should be identical, including overflow. (Force bidi: &#x05D0;)</p>
+
+ <div>
+ <p>a<span class="b">b</span><span class="c">c</span><span class="d">d</span><span class="e">e</span>fgh<span class="i">i</span><span class="j">j</span><span class="k">k</span>lm</p>
+
+ <p>a<span class="b">b</span><span class="c">c</span><span class="d">d</span><span class="e">e</span>fgh<span class="i">i</span><span class="j">j</span><span class="k">k</span>lm</p>
+ </div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-008b.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-008b.xht
new file mode 100644
index 0000000000..aad9aabcd5
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-008b.xht
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+ <head>
+
+ <title>CSS Test: The bidi algorithm and inlines in CSS: embed levels and display: table; </title>
+ <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-01 -->
+ <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/inline/bidi/008.html" type="text/html"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction"/>
+ <link rel="help" href="http://www.w3.org/TR/css-text-3/#letter-spacing-property"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-control-codes"/>
+ <link rel="help" href="http://unicode.org/reports/tr9/"/>
+ <link rel="match" href="bidi-008b-ref.xht" />
+
+ <style type="text/css">
+ div p { display: table; margin: 1em; padding: 0.75em; background: black; color: yellow; font: 2em/1 serif; letter-spacing: 1em; }
+ .one, .c, .j, .e { color: aqua; }
+ .two, .i, .d, .k, .b { color: fuchsia; }
+ </style>
+ </head>
+ <body>
+ <p> The following two blocks should be identical, including overflow. (Force bidi: &#x05D0;) </p>
+ <div>
+ <p class="reference"><span class="a">a</span><span class="b">b</span><span class="c">c</span><span class="d">d</span><span class="e">e</span><span class="f">f</span><span class="g">g</span><span class="h">h</span><span class="i">i</span><span class="j">j</span><span class="k">k</span><span class="l">l</span><span class="m">m</span></p>
+ <p class="test">a&#x202E;l&#x202D;<span class="one">c&#x202E;j&#x202D;e&#x202E;</span>h&#x202D;g&#x202C;f<span class="two">&#x202C;i&#x202C;d&#x202C;k&#x202C;b</span>&#x202C;m</p>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-009a.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-009a.xht
new file mode 100644
index 0000000000..9a6f629486
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-009a.xht
@@ -0,0 +1,37 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+ <head>
+
+ <title>CSS Test: The bidi algorithm and inlines in CSS: embed levels and display: table-row; </title>
+ <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-01 -->
+ <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/inline/bidi/009.html" type="text/html"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-control-codes"/>
+ <link rel="help" href="http://unicode.org/reports/tr9/"/>
+ <link rel="match" href="bidi-005a-ref.xht" />
+
+ <style type="text/css">
+ div { margin: 1em; padding: 0.75em; background: black; color: yellow;
+ font: 2em/1 serif; }
+ div p { display: table-row; }
+ .one, .c, .j, .e { color: aqua; }
+ .two, .i, .d, .k, .b { color: fuchsia; }
+ .one, .two { border: solid; padding: 0.1em 0 0.1em 0; margin: 0 0.5em 0 0.5em; }
+ .c, .b { border-style: solid none solid solid; padding: 0.1em 0 0.1em 0; margin: 0 0 0 0.5em; }
+ .j, .k { border-style: solid solid solid none; padding: 0.1em 0 0.1em 0; margin: 0 0.5em 0 0; }
+ .e, .i, .d { border-style: solid none solid none; padding: 0.1em 0 0.1em 0; margin: 0 0 0 0; }
+ </style>
+ </head>
+ <body>
+ <p> The following two blocks should be identical, including overflow. (Force bidi: &#x05D0;) </p>
+ <div>
+ <p class="reference"><span class="a">a</span><span class="b">b</span><span class="c">c</span><span class="d">d</span><span class="e">e</span><span class="f">f</span><span class="g">g</span><span class="h">h</span><span class="i">i</span><span class="j">j</span><span class="k">k</span><span class="l">l</span><span class="m">m</span></p>
+ </div>
+ <div>
+ <p class="test">a&#x202E;l&#x202D;<span class="one">c&#x202E;j&#x202D;e&#x202E;</span>h&#x202D;g&#x202C;f<span class="two">&#x202C;i&#x202C;d&#x202C;k&#x202C;b</span>&#x202C;m</p>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-009b.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-009b.xht
new file mode 100644
index 0000000000..8de198c602
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-009b.xht
@@ -0,0 +1,31 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+ <head>
+
+ <title>CSS Test: The bidi algorithm and inlines in CSS: embed levels and display: table-row; </title>
+ <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-01 -->
+ <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/inline/bidi/009.html" type="text/html"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction"/>
+ <link rel="help" href="http://unicode.org/reports/tr9/"/>
+ <link rel="match" href="bidi-005b-ref.xht" />
+
+ <style type="text/css">
+ div { margin: 1em; padding: 0.75em; background: black; color: yellow;
+ letter-spacing: 1em; font: 2em/1 serif; }
+ div p { display: table-row; }
+ .one, .c, .j, .e { color: aqua; }
+ .two, .i, .d, .k, .b { color: fuchsia; }
+ </style>
+ </head>
+ <body>
+ <p> The following two blocks should be identical, including overflow. (Force bidi: &#x05D0;) </p>
+ <div>
+ <p class="reference"><span class="a">a</span><span class="b">b</span><span class="c">c</span><span class="d">d</span><span class="e">e</span><span class="f">f</span><span class="g">g</span><span class="h">h</span><span class="i">i</span><span class="j">j</span><span class="k">k</span><span class="l">l</span><span class="m">m</span></p>
+ </div>
+ <div>
+ <p class="test">a&#x202E;l&#x202D;<span class="one">c&#x202E;j&#x202D;e&#x202E;</span>h&#x202D;g&#x202C;f<span class="two">&#x202C;i&#x202C;d&#x202C;k&#x202C;b</span>&#x202C;m</p>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-010a.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-010a.xht
new file mode 100644
index 0000000000..4b59622d03
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-010a.xht
@@ -0,0 +1,36 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+ <head>
+
+ <title>CSS Test: The bidi algorithm and inlines in CSS: embed levels and position: absolute </title>
+ <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-01 -->
+ <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/inline/bidi/010.html" type="text/html"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-control-codes"/>
+ <link rel="help" href="http://unicode.org/reports/tr9/"/>
+ <link rel="match" href="bidi-007a-ref.xht" />
+
+ <style type="text/css">
+ div { position: relative; }
+ .reference { top: -.5em; }
+ .test { top: 3em; }
+ div p { position: absolute; margin: 1em; padding: 0.75em; background: black; color: yellow; font: 2em/1 serif; }
+ .one, .c, .j, .e { color: aqua; }
+ .two, .i, .d, .k, .b { color: fuchsia; }
+ .one, .two { border: solid; padding: 0.1em 0 0.1em 0; margin: 0 0.5em 0 0.5em; }
+ .c, .b { border-style: solid none solid solid; padding: 0.1em 0 0.1em 0; margin: 0 0 0 0.5em; }
+ .j, .k { border-style: solid solid solid none; padding: 0.1em 0 0.1em 0; margin: 0 0.5em 0 0; }
+ .e, .i, .d { border-style: solid none solid none; padding: 0.1em 0 0.1em 0; margin: 0 0 0 0; }
+ </style>
+ </head>
+ <body>
+ <p> The following two blocks should be identical, including overflow. (Force bidi: &#x05D0;) </p>
+ <div>
+ <p class="reference"><span class="a">a</span><span class="b">b</span><span class="c">c</span><span class="d">d</span><span class="e">e</span><span class="f">f</span><span class="g">g</span><span class="h">h</span><span class="i">i</span><span class="j">j</span><span class="k">k</span><span class="l">l</span><span class="m">m</span></p>
+ <p class="test">a&#x202E;l&#x202D;<span class="one">c&#x202E;j&#x202D;e&#x202E;</span>h&#x202D;g&#x202C;f<span class="two">&#x202C;i&#x202C;d&#x202C;k&#x202C;b</span>&#x202C;m</p>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-010b.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-010b.xht
new file mode 100644
index 0000000000..eb10d8cb7c
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-010b.xht
@@ -0,0 +1,33 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+ <head>
+
+ <title>CSS Test: The bidi algorithm and inlines in CSS: embed levels and position: absolute </title>
+ <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-01 -->
+ <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/inline/bidi/010.html" type="text/html"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction"/>
+ <link rel="help" href="http://www.w3.org/TR/css-text-3/#letter-spacing-property"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-control-codes"/>
+ <link rel="help" href="http://unicode.org/reports/tr9/"/>
+ <link rel="match" href="bidi-007b-ref.xht" />
+
+ <style type="text/css">
+ div { position: relative; }
+ .reference { top: -.5em; }
+ .test { top: 3em; }
+ div p { position: absolute; margin: 1em; padding: 0.75em; background: black; color: yellow; font: 2em/1 serif; letter-spacing: 1em; }
+ .one, .c, .j, .e { color: aqua; }
+ .two, .i, .d, .k, .b { color: fuchsia; }
+ </style>
+ </head>
+ <body>
+ <p> The following two blocks should be identical, including overflow. (Force bidi: &#x05D0;) </p>
+ <div>
+ <p class="reference"><span class="a">a</span><span class="b">b</span><span class="c">c</span><span class="d">d</span><span class="e">e</span><span class="f">f</span><span class="g">g</span><span class="h">h</span><span class="i">i</span><span class="j">j</span><span class="k">k</span><span class="l">l</span><span class="m">m</span></p>
+ <p class="test">a&#x202E;l&#x202D;<span class="one">c&#x202E;j&#x202D;e&#x202E;</span>h&#x202D;g&#x202C;f<span class="two">&#x202C;i&#x202C;d&#x202C;k&#x202C;b</span>&#x202C;m</p>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-011-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-011-ref.xht
new file mode 100644
index 0000000000..25821d4235
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-011-ref.xht
@@ -0,0 +1,40 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+
+ <title>CSS Reftest Reference</title>
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ div
+ {
+ border: black solid;
+ color: navy;
+ font: 2em monospace;
+ margin: 1em;
+ padding: 1em;
+ }
+
+ span
+ {
+ background-color: yellow;
+ border: orange solid;
+ margin: 0.1em 1em;
+ padding: 0.1em 1em;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+
+ <p>The following two lines should be identical. (Force bidi: &#x05D0;)</p>
+
+ <div>TEST<span>TEST</span></div>
+
+ <div>TEST<span>TEST</span></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-011.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-011.xht
new file mode 100644
index 0000000000..6370e11483
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-011.xht
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+ <head>
+
+ <title>CSS Test: The bidi algorithm and inlines in CSS wrapping bidi formatting characters</title>
+ <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-07-01 -->
+ <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/inline/bidi/011.html" type="text/html"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-control-codes"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction"/>
+ <link rel="help" href="http://unicode.org/reports/tr9/"/>
+ <link rel="match" href="bidi-011-ref.xht" />
+
+ <style type="text/css">
+ div div { border: solid black; color: navy; margin: 1em; padding: 1em; font: 2em monospace; }
+ span { border: solid orange; padding: 0.1em 1em; margin: 0.1em 1em; background: yellow; }
+ </style>
+ </head>
+ <body>
+ <p> The following two lines should be identical. (Force bidi: &#x05D0;) </p>
+ <div>
+ <div class="test">TE<span>&#x202E;TSET</span>&#x202D;ST </div>
+ <div class="reference">TEST<span>TEST</span></div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-alt-001.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-alt-001.xht
new file mode 100644
index 0000000000..0872f42f37
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-alt-001.xht
@@ -0,0 +1,33 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: unicode-bidi: bidi-override in alt text</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#unicode-bidi"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction"/>
+ <meta name="assert" content="If alt text is not treated as replaced content, then unicode-bidi applies to image alt text."/>
+ <style type="text/css"><![CDATA[
+ .rtol {
+ direction: rtl;
+ unicode-bidi: bidi-override;
+ }
+ img {
+ color:blue;
+ width: 0; /* If alt text is treated as replaced content, then this makes it invisible. */
+ /* (The rendering of replaced content is out-of-scope for CSS.) */
+ display: inline;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+
+ <p>The three lines below should be <strong>identical</strong>.</p>
+
+ <p>Three lines of <img src="" alt="readable" width="0"/> text</p>
+ <p>Three lines of <span class="rtol"><img src="" alt="elbadaer" width="0"/></span> text</p>
+ <p>Three lines of <img src="" alt="elbadaer" class="rtol" width="0"/> text</p>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-001-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-001-ref.xht
new file mode 100644
index 0000000000..33a6d048a2
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-001-ref.xht
@@ -0,0 +1,31 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+ <title>CSS Reftest Reference</title>
+
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ span
+ {
+ border-color: orange purple teal yellow;
+ border-style: solid;
+ border-width: 5px;
+ }
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>Test passes if the 2 lines are <strong>identical</strong>.</p>
+
+ <p>First <span>Second</span></p>
+
+ <p>First <span>Second</span></p>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-001.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-001.xht
new file mode 100644
index 0000000000..e489e63240
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-001.xht
@@ -0,0 +1,36 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - borders on inline in normal block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="match" href="bidi-box-model-001-ref.xht" />
+
+ <meta name="assert" content="Border sides should be unaffected by directionality"/>
+ <style type="text/css"><![CDATA[
+ span {
+ border: 5px solid gray;
+ border-color: orange purple teal yellow;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: normal;
+ }
+
+ p {text-align: left;}
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 lines are <strong>identical</strong>.</p>
+ <p>
+ First <span>Second</span>
+ </p>
+ <p class="rtol">
+ First <span>Second</span>
+ </p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-002.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-002.xht
new file mode 100644
index 0000000000..4bb1a15e59
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-002.xht
@@ -0,0 +1,36 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - borders on inline in embed block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="match" href="bidi-box-model-001-ref.xht" />
+
+ <meta name="assert" content="Border sides should be unaffected by directionality"/>
+ <style type="text/css"><![CDATA[
+ span {
+ border: 5px solid gray;
+ border-color: orange purple teal yellow;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: embed;
+ }
+
+ p {text-align: left;}
+ ]]></style>
+</head>
+
+<body>
+ <p>Test passes if the 2 lines are <strong>identical</strong>.</p>
+ <p>
+ First <span>Second</span>
+ </p>
+ <p class="rtol">
+ First <span>Second</span>
+ </p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-003.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-003.xht
new file mode 100644
index 0000000000..e62a34778f
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-003.xht
@@ -0,0 +1,36 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - borders on inline in bidi-override block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="match" href="bidi-box-model-001-ref.xht" />
+
+ <meta name="assert" content="Border sides should be unaffected by directionality"/>
+ <style type="text/css"><![CDATA[
+ span {
+ border: 5px solid gray;
+ border-color: orange purple teal yellow;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: bidi-override;
+ }
+
+ p {text-align: left;}
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 lines are <strong>identical</strong>.</p>
+ <p>
+ First <span>Second</span>
+ </p>
+ <p class="rtol">
+ <span>dnoceS</span> tsriF
+ </p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-004.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-004.xht
new file mode 100644
index 0000000000..4e4f8204ac
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-004.xht
@@ -0,0 +1,36 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - borders on normal inline</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="match" href="bidi-box-model-001-ref.xht" />
+
+ <meta name="assert" content="Border sides should be unaffected by directionality"/>
+ <style type="text/css"><![CDATA[
+ span {
+ border: 5px solid gray;
+ border-color: orange purple teal yellow;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: normal;
+ }
+
+ p {text-align: left;}
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 lines are <strong>identical</strong>.</p>
+ <p>
+ First <span>Second</span>
+ </p>
+ <p>
+ First <span class="rtol">Second</span>
+ </p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-005.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-005.xht
new file mode 100644
index 0000000000..c04dc983c3
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-005.xht
@@ -0,0 +1,36 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - borders on embed inline</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="match" href="bidi-box-model-001-ref.xht" />
+
+ <meta name="assert" content="Border sides should be unaffected by directionality"/>
+ <style type="text/css"><![CDATA[
+ span {
+ border: 5px solid gray;
+ border-color: orange purple teal yellow;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: embed;
+ }
+
+ p {text-align: left;}
+ ]]></style>
+</head>
+
+<body>
+ <p>Test passes if the 2 lines are <strong>identical</strong>.</p>
+ <p>
+ First <span>Second</span>
+ </p>
+ <p>
+ First <span class="rtol">Second</span>
+ </p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-006.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-006.xht
new file mode 100644
index 0000000000..b78acf3647
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-006.xht
@@ -0,0 +1,36 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - borders on bidi-override inline</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="match" href="bidi-box-model-001-ref.xht" />
+
+ <meta name="assert" content="Border sides should be unaffected by directionality"/>
+ <style type="text/css"><![CDATA[
+ span {
+ border: 5px solid gray;
+ border-color: orange purple teal yellow;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: bidi-override;
+ }
+
+ p {text-align: left;}
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 lines are <strong>identical</strong>.</p>
+ <p>
+ First <span>Second</span>
+ </p>
+ <p>
+ First <span class="rtol">dnoceS</span>
+ </p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-007-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-007-ref.xht
new file mode 100644
index 0000000000..d330cbc23a
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-007-ref.xht
@@ -0,0 +1,33 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+ <title>CSS Reftest Reference</title>
+
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ div
+ {
+ border-color: orange purple teal yellow;
+ border-style: solid;
+ border-width: 5px;
+ margin-bottom: 1em;
+ width: 10em;
+ }
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>Test passes if the 2 lines are <strong>identical</strong>.</p>
+
+ <div>Text</div>
+
+ <div>Text</div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-007.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-007.xht
new file mode 100644
index 0000000000..1c49616bc0
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-007.xht
@@ -0,0 +1,39 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - borders on normal block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="match" href="bidi-box-model-007-ref.xht" />
+
+ <meta name="assert" content="Border sides should be unaffected by directionality"/>
+ <style type="text/css"><![CDATA[
+ div {
+ border: 5px solid gray;
+ border-color: orange purple teal yellow;
+ text-align: left;
+ width: 10em;
+ margin-bottom: 1em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: normal;
+ }
+
+ p {text-align: left;}
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 lines are <strong>identical</strong>.</p>
+ <div>
+ Text
+ </div>
+ <div class="rtol">
+ Text
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-008.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-008.xht
new file mode 100644
index 0000000000..ea17c6b5af
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-008.xht
@@ -0,0 +1,39 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - borders on embed block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="match" href="bidi-box-model-007-ref.xht" />
+
+ <meta name="assert" content="Border sides should be unaffected by directionality"/>
+ <style type="text/css"><![CDATA[
+ div {
+ border: 5px solid gray;
+ border-color: orange purple teal yellow;
+ text-align: left;
+ width: 10em;
+ margin-bottom: 1em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: embed;
+ }
+
+ p {text-align: left;}
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 lines are <strong>identical</strong>.</p>
+ <div>
+ Text
+ </div>
+ <div class="rtol">
+ Text
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-009.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-009.xht
new file mode 100644
index 0000000000..fc2a6f8307
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-009.xht
@@ -0,0 +1,39 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - borders on bidi-override block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="match" href="bidi-box-model-007-ref.xht" />
+
+ <meta name="assert" content="Border sides should be unaffected by directionality"/>
+ <style type="text/css"><![CDATA[
+ div {
+ border: 5px solid gray;
+ border-color: orange purple teal yellow;
+ text-align: left;
+ width: 10em;
+ margin-bottom: 1em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: bidi-override;
+ }
+
+ p {text-align: left;}
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 lines are <strong>identical</strong>.</p>
+ <div>
+ Text
+ </div>
+ <div class="rtol">
+ txeT
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-010-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-010-ref.xht
new file mode 100644
index 0000000000..41703fbbf0
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-010-ref.xht
@@ -0,0 +1,32 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+ <title>CSS Reftest Reference</title>
+
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ div
+ {
+ line-height: 1.25em;
+ margin-bottom: 1.25em;
+ }
+
+ img {vertical-align: top;}
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+
+ <div><img src="support/swatch-teal.png" width="100" height="20" alt="Image download support must be enabled" /><img src="support/1x1-navy.png" width="60" height="20" alt="Image download support must be enabled" /><img src="support/swatch-orange.png" width="120" height="20" alt="Image download support must be enabled" /><img src="support/1x1-navy.png" width="120" height="20" alt="Image download support must be enabled" /></div>
+
+ <div><img src="support/swatch-teal.png" width="100" height="20" alt="Image download support must be enabled" /><img src="support/1x1-navy.png" width="60" height="20" alt="Image download support must be enabled" /><img src="support/swatch-orange.png" width="120" height="20" alt="Image download support must be enabled" /><img src="support/1x1-navy.png" width="120" height="20" alt="Image download support must be enabled" /></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-010.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-010.xht
new file mode 100644
index 0000000000..cb2d8900c7
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-010.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - margin-left on bidi-override inline</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-010-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side margins should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ span {
+ color: orange;
+ margin-left: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: bidi-override;
+ }
+
+ div {
+ text-align: left;
+ font: 1.25em/1 Ahem;
+ width: 20em;
+ background: navy;
+ color: teal;
+ margin-bottom: 1em;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+ <div>
+ First <span>Second</span>
+ </div>
+ <div>
+ First <span class="rtol">dnoceS</span>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-011.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-011.xht
new file mode 100644
index 0000000000..870ff0b284
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-011.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - margin-left on normal inline</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-010-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side margins should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ span {
+ color: orange;
+ margin-left: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: normal;
+ }
+
+ div {
+ text-align: left;
+ width: 20em;
+ font: 1.25em/1 Ahem;
+ background: navy;
+ color: teal;
+ margin-bottom: 1em;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+ <div>
+ First <span>Second</span>
+ </div>
+ <div>
+ First <span class="rtol">Second</span>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-012.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-012.xht
new file mode 100644
index 0000000000..38de262547
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-012.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - margin-left on embed inline</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-010-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side margins should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ span {
+ color: orange;
+ margin-left: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: embed;
+ }
+
+ div {
+ text-align: left;
+ width: 20em;
+ font: 1.25em/1 Ahem;
+ background: navy;
+ color: teal;
+ margin-bottom: 1em;
+ }
+ ]]></style>
+</head>
+
+<body>
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+ <div>
+ First <span>Second</span>
+ </div>
+ <div>
+ First <span class="rtol">Second</span>
+ </div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-013.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-013.xht
new file mode 100644
index 0000000000..3facbbc284
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-013.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - margin-left on inline in bidi-override block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-010-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side margins should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ span {
+ color: orange;
+ margin-left: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: bidi-override;
+ }
+
+ div {
+ text-align: left;
+ width: 20em;
+ font: 1.25em/1 Ahem;
+ background: navy;
+ color: teal;
+ margin-bottom: 1em;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+ <div>
+ First <span>Second</span>
+ </div>
+ <div class="rtol">
+ <span>dnoceS</span> tsriF
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-014.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-014.xht
new file mode 100644
index 0000000000..fbe1ca1bd8
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-014.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - margin-left on inline in normal block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-010-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side margins should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ span {
+ color: orange;
+ margin-left: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: normal;
+ }
+
+ div {
+ font: 1.25em/1 Ahem;
+ text-align: left;
+ width: 20em;
+ background: navy;
+ color: teal;
+ margin-bottom: 1em;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+ <div>
+ First <span>Second</span>
+ </div>
+ <div class="rtol">
+ First <span>Second</span>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-015.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-015.xht
new file mode 100644
index 0000000000..fa76c17dfc
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-015.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - margin-left on inline in embed block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-010-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side margins should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ span {
+ color: orange;
+ margin-left: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: embed;
+ }
+
+ div {
+ text-align: left;
+ width: 20em;
+ font: 1.25em/1 Ahem;
+ background: navy;
+ color: teal;
+ margin-bottom: 1em;
+ }
+ ]]></style>
+</head>
+
+<body>
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+ <div>
+ First <span>Second</span>
+ </div>
+ <div class="rtol">
+ First <span>Second</span>
+ </div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-016-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-016-ref.xht
new file mode 100644
index 0000000000..abd4d41b12
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-016-ref.xht
@@ -0,0 +1,33 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+ <title>CSS Reftest Reference</title>
+
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ div
+ {
+ line-height: 1.25em;
+ margin-bottom: 1.25em;
+ margin-left: 2.5em;
+ }
+
+ img {vertical-align: top;}
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>Test passes if the 2 bicolored stripes are <strong>identical</strong> with identical left margin.</p>
+
+ <div><img src="support/swatch-orange.png" width="80" height="20" alt="Image download support must be enabled" /><img src="support/1x1-navy.png" width="120" height="20" alt="Image download support must be enabled" /></div>
+
+ <div><img src="support/swatch-orange.png" width="80" height="20" alt="Image download support must be enabled" /><img src="support/1x1-navy.png" width="120" height="20" alt="Image download support must be enabled" /></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-016.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-016.xht
new file mode 100644
index 0000000000..3f177630a5
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-016.xht
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - margin-left on bidi-override block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-016-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side margins should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ div {
+ text-align: left;
+ width: 10em;
+ margin-left: 2em;
+ margin-bottom: 1em;
+ background: navy;
+ font: 1.25em/1 Ahem;
+ color: orange;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: bidi-override;
+ }
+
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 bicolored stripes are <strong>identical</strong> with identical left margin.</p>
+ <div>
+ Text
+ </div>
+ <div class="rtol">
+ txeT
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-017.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-017.xht
new file mode 100644
index 0000000000..108574185a
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-017.xht
@@ -0,0 +1,40 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - margin-left on normal block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-016-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side margins should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ div {
+ background: navy;
+ color: orange;
+ font: 1.25em/1 Ahem;
+ text-align: left;
+ width: 10em;
+ margin-bottom: 1em;
+ margin-left: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: normal;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 bicolored stripes are <strong>identical</strong> with identical left margin.</p>
+ <div>
+ Text
+ </div>
+ <div class="rtol">
+ Text
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-018.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-018.xht
new file mode 100644
index 0000000000..369e7f68cc
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-018.xht
@@ -0,0 +1,40 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - margin-left on embed block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-016-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side margins should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ div {
+ background: navy;
+ color: orange;
+ font: 1.25em/1 Ahem;
+ text-align: left;
+ width: 10em;
+ margin-bottom: 1em;
+ margin-left: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: embed;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 bicolored stripes are <strong>identical</strong> with identical left margin.</p>
+ <div>
+ Text
+ </div>
+ <div class="rtol">
+ Text
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-019-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-019-ref.xht
new file mode 100644
index 0000000000..d42ce6105e
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-019-ref.xht
@@ -0,0 +1,32 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+ <title>CSS Reftest Reference</title>
+
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ div
+ {
+ line-height: 1.25em;
+ margin-bottom: 1.25em;
+ }
+
+ img {vertical-align: top;}
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+
+ <div><img src="support/1x1-navy.png" width="120" height="20" alt="Image download support must be enabled" /><img src="support/swatch-teal.png" width="100" height="20" alt="Image download support must be enabled" /><img src="support/1x1-navy.png" width="20" height="20" alt="Image download support must be enabled" /><img src="support/swatch-orange.png" width="120" height="20" alt="Image download support must be enabled" /><img src="support/1x1-navy.png" width="40" height="20" alt="Image download support must be enabled" /></div>
+
+ <div><img src="support/1x1-navy.png" width="120" height="20" alt="Image download support must be enabled" /><img src="support/swatch-teal.png" width="100" height="20" alt="Image download support must be enabled" /><img src="support/1x1-navy.png" width="20" height="20" alt="Image download support must be enabled" /><img src="support/swatch-orange.png" width="120" height="20" alt="Image download support must be enabled" /><img src="support/1x1-navy.png" width="40" height="20" alt="Image download support must be enabled" /></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-019.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-019.xht
new file mode 100644
index 0000000000..3ea26af3ed
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-019.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - margin-right on bidi-override inline</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-019-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side margins should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ span {
+ color: orange;
+ margin-right: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: bidi-override;
+ }
+
+ div {
+ font: 1.25em/1 Ahem;
+ text-align: right;
+ width: 20em;
+ background: navy;
+ color: teal;
+ margin-bottom: 1em;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+ <div>
+ First <span>Second</span>
+ </div>
+ <div>
+ First <span class="rtol">dnoceS</span>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-020.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-020.xht
new file mode 100644
index 0000000000..932e16613f
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-020.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - margin-right on normal inline</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-019-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side margins should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ span {
+ color: orange;
+ margin-right: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: normal;
+ }
+
+ div {
+ font: 1.25em/1 Ahem;
+ text-align: right;
+ width: 20em;
+ background: navy;
+ color: teal;
+ margin-bottom: 1em;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+ <div>
+ First <span>Second</span>
+ </div>
+ <div>
+ First <span class="rtol">Second</span>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-021.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-021.xht
new file mode 100644
index 0000000000..848cfd6d96
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-021.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - margin-right on embed inline</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-019-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side margins should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ span {
+ color: orange;
+ margin-right: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: embed;
+ }
+
+ div {
+ font: 1.25em/1 Ahem;
+ text-align: right;
+ width: 20em;
+ background: navy;
+ color: teal;
+ margin-bottom: 1em;
+ }
+ ]]></style>
+</head>
+
+<body>
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+ <div>
+ First <span>Second</span>
+ </div>
+ <div>
+ First <span class="rtol">Second</span>
+ </div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-022.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-022.xht
new file mode 100644
index 0000000000..564a271101
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-022.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - margin-right on inline in bidi-override block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-019-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side margins should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ span {
+ color: orange;
+ margin-right: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: bidi-override;
+ }
+
+ div {
+ font: 1.25em/1 Ahem;
+ text-align: right;
+ width: 20em;
+ background: navy;
+ color: teal;
+ margin-bottom: 1em;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+ <div>
+ First <span>Second</span>
+ </div>
+ <div class="rtol">
+ <span>dnoceS</span> tsriF
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-023.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-023.xht
new file mode 100644
index 0000000000..27c9deb88e
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-023.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - margin-right on inline in normal block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-019-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side margins should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ span {
+ color: orange;
+ margin-right: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: normal;
+ }
+
+ div {
+ text-align: right;
+ width: 20em;
+ font: 1.25em/1 Ahem;
+ background: navy;
+ color: teal;
+ margin-bottom: 1em;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+ <div>
+ First <span>Second</span>
+ </div>
+ <div class="rtol">
+ First <span>Second</span>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-024.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-024.xht
new file mode 100644
index 0000000000..81d3cb695f
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-024.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - margin-right on inline in embed block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-019-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side margins should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ span {
+ color: orange;
+ margin-right: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: embed;
+ }
+
+ div {
+ text-align: right;
+ width: 20em;
+ font: 1.25em/1 Ahem;
+ background: navy;
+ color: teal;
+ margin-bottom: 1em;
+ }
+ ]]></style>
+</head>
+
+<body>
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+ <div>
+ First <span>Second</span>
+ </div>
+ <div class="rtol">
+ First <span>Second</span>
+ </div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-025-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-025-ref.xht
new file mode 100644
index 0000000000..e5f95b193a
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-025-ref.xht
@@ -0,0 +1,35 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+ <title>CSS Reftest Reference</title>
+
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ div
+ {
+ background-color: navy;
+ line-height: 1.25em;
+ margin-bottom: 1.25em;
+ margin-right: 6.25em;
+ text-align: right;
+ }
+
+ img {vertical-align: top;}
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>Test passes if the 2 wide bicolored stripes are <strong>identical</strong> with identical right margin.</p>
+
+ <div><img src="support/swatch-orange.png" width="80" height="20" alt="Image download support must be enabled" /></div>
+
+ <div><img src="support/swatch-orange.png" width="80" height="20" alt="Image download support must be enabled" /></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-025.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-025.xht
new file mode 100644
index 0000000000..a312a161c6
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-025.xht
@@ -0,0 +1,40 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - margin-right on bidi-override block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-025-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side margins should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ div {
+ text-align: right;
+ margin-right: 5em;
+ margin-bottom: 1em;
+ background: navy;
+ font: 1.25em/1 Ahem;
+ color: orange;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: bidi-override;
+ }
+
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 wide bicolored stripes are <strong>identical</strong> with identical right margin.</p>
+ <div>
+ Text
+ </div>
+ <div class="rtol">
+ txeT
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-026.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-026.xht
new file mode 100644
index 0000000000..16482ac89c
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-026.xht
@@ -0,0 +1,39 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - margin-right on normal block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-025-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side margins should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ div {
+ background: navy;
+ color: orange;
+ font: 1.25em/1 Ahem;
+ text-align: right;
+ margin-bottom: 1em;
+ margin-right: 5em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: normal;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 wide bicolored stripes are <strong>identical</strong> with identical right margin.</p>
+ <div>
+ Text
+ </div>
+ <div class="rtol">
+ Text
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-027.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-027.xht
new file mode 100644
index 0000000000..74acda04c2
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-027.xht
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - margin-right on embed block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-025-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side margins should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ div {
+ background: navy;
+ color: orange;
+ font: 1.25em/1 Ahem;
+ text-align: right;
+ margin-bottom: 1em;
+ margin-right: 5em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: embed;
+ }
+
+ p {text-align: left;}
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 wide bicolored stripes are <strong>identical</strong> with identical right margin.</p>
+ <div>
+ Text
+ </div>
+ <div class="rtol">
+ Text
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-028.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-028.xht
new file mode 100644
index 0000000000..a4cc157ced
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-028.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - padding-left on bidi-override inline</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-010-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side padding should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ span {
+ color: orange;
+ padding-left: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: bidi-override;
+ }
+
+ div {
+ text-align: left;
+ font: 1.25em/1 Ahem;
+ width: 20em;
+ background: navy;
+ color: teal;
+ margin-bottom: 1em;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+ <div>
+ First <span>Second</span>
+ </div>
+ <div>
+ First <span class="rtol">dnoceS</span>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-029.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-029.xht
new file mode 100644
index 0000000000..e1fcc74e75
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-029.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - padding-left on inline in normal block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-010-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side padding should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ span {
+ color: orange;
+ padding-left: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: normal;
+ }
+
+ div {
+ text-align: left;
+ width: 20em;
+ font: 1.25em/1 Ahem;
+ background: navy;
+ color: teal;
+ margin-bottom: 1em;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+ <div>
+ First <span>Second</span>
+ </div>
+ <div class="rtol">
+ First <span>Second</span>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-030.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-030.xht
new file mode 100644
index 0000000000..53846c900f
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-030.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - padding-left on inline in embed block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-010-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side padding should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ span {
+ color: orange;
+ padding-left: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: embed;
+ }
+
+ div {
+ text-align: left;
+ width: 20em;
+ font: 1.25em/1 Ahem;
+ background: navy;
+ color: teal;
+ margin-bottom: 1em;
+ }
+ ]]></style>
+</head>
+
+<body>
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+ <div>
+ First <span>Second</span>
+ </div>
+ <div class="rtol">
+ First <span>Second</span>
+ </div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-031.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-031.xht
new file mode 100644
index 0000000000..d9c7bb6dad
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-031.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - padding-left on inline in bidi-override block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-010-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side padding should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ span {
+ color: orange;
+ padding-left: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: bidi-override;
+ }
+
+ div {
+ text-align: left;
+ width: 20em;
+ font: 1.25em/1 Ahem;
+ background: navy;
+ color: teal;
+ margin-bottom: 1em;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+ <div>
+ First <span>Second</span>
+ </div>
+ <div class="rtol">
+ <span>dnoceS</span> tsriF
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-032.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-032.xht
new file mode 100644
index 0000000000..f6ecf77ccf
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-032.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - padding-left on normal inline</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-010-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side padding should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ span {
+ color: orange;
+ padding-left: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: normal;
+ }
+
+ div {
+ font: 1.25em/1 Ahem;
+ text-align: left;
+ width: 20em;
+ background: navy;
+ color: teal;
+ margin-bottom: 1em;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+ <div>
+ First <span>Second</span>
+ </div>
+ <div>
+ First <span class="rtol">Second</span>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-033.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-033.xht
new file mode 100644
index 0000000000..f35dc1ab9a
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-033.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - padding-left on embed inline</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-010-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side padding should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ span {
+ color: orange;
+ padding-left: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: embed;
+ }
+
+ div {
+ text-align: left;
+ width: 20em;
+ font: 1.25em/1 Ahem;
+ background: navy;
+ color: teal;
+ margin-bottom: 1em;
+ }
+ ]]></style>
+</head>
+
+<body>
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+ <div>
+ First <span>Second</span>
+ </div>
+ <div>
+ First <span class="rtol">Second</span>
+ </div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-034-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-034-ref.xht
new file mode 100644
index 0000000000..96b7530437
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-034-ref.xht
@@ -0,0 +1,32 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+ <title>CSS Reftest Reference</title>
+
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ div
+ {
+ line-height: 1.25em;
+ margin-bottom: 1.25em;
+ }
+
+ img {vertical-align: top;}
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>Test passes if the 2 bicolored stripes are <strong>identical</strong>.</p>
+
+ <div><img src="support/1x1-navy.png" width="40" height="20" alt="Image download support must be enabled" /><img src="support/swatch-orange.png" width="80" height="20" alt="Image download support must be enabled" /><img src="support/1x1-navy.png" width="120" height="20" alt="Image download support must be enabled" /></div>
+
+ <div><img src="support/1x1-navy.png" width="40" height="20" alt="Image download support must be enabled" /><img src="support/swatch-orange.png" width="80" height="20" alt="Image download support must be enabled" /><img src="support/1x1-navy.png" width="120" height="20" alt="Image download support must be enabled" /></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-034.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-034.xht
new file mode 100644
index 0000000000..9b4eb05eaf
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-034.xht
@@ -0,0 +1,42 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - padding-left on bidi-override block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="match" href="bidi-box-model-034-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side padding should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ div {
+ text-align: left;
+ width: 10em;
+ padding-left: 2em;
+ margin-bottom: 1em;
+ background: navy;
+ font: 1.25em/1 Ahem;
+ color: orange;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: bidi-override;
+ }
+
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 bicolored stripes are <strong>identical</strong>.</p>
+ <div>
+ Text
+ </div>
+ <div class="rtol">
+ txeT
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-035.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-035.xht
new file mode 100644
index 0000000000..99ba45be03
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-035.xht
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - padding-left on normal block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="match" href="bidi-box-model-034-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side padding should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ div {
+ background: navy;
+ color: orange;
+ font: 1.25em/1 Ahem;
+ text-align: left;
+ width: 10em;
+ margin-bottom: 1em;
+ padding-left: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: normal;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 bicolored stripes are <strong>identical</strong>.</p>
+ <div>
+ Text
+ </div>
+ <div class="rtol">
+ Text
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-036.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-036.xht
new file mode 100644
index 0000000000..fce96d2757
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-036.xht
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - padding-left on embed block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="match" href="bidi-box-model-034-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side padding should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ div {
+ background: navy;
+ color: orange;
+ font: 1.25em/1 Ahem;
+ text-align: left;
+ width: 10em;
+ margin-bottom: 1em;
+ padding-left: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: embed;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 bicolored stripes are <strong>identical</strong>.</p>
+ <div>
+ Text
+ </div>
+ <div class="rtol">
+ Text
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-037.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-037.xht
new file mode 100644
index 0000000000..8b2007757c
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-037.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - padding-right on bidi-override inline</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-019-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side padding should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ span {
+ color: orange;
+ padding-right: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: bidi-override;
+ }
+
+ div {
+ font: 1.25em/1 Ahem;
+ text-align: right;
+ width: 20em;
+ background: navy;
+ color: teal;
+ margin-bottom: 1em;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+ <div>
+ First <span>Second</span>
+ </div>
+ <div>
+ First <span class="rtol">dnoceS</span>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-038.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-038.xht
new file mode 100644
index 0000000000..a820aabe05
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-038.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - padding-right on inline in normal block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-019-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side padding should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ span {
+ color: orange;
+ padding-right: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: normal;
+ }
+
+ div {
+ font: 1.25em/1 Ahem;
+ text-align: right;
+ width: 20em;
+ background: navy;
+ color: teal;
+ margin-bottom: 1em;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+ <div>
+ First <span>Second</span>
+ </div>
+ <div class="rtol">
+ First <span>Second</span>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-039.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-039.xht
new file mode 100644
index 0000000000..9f32397752
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-039.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - padding-right on inline in embed block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-019-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side padding should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ span {
+ color: orange;
+ padding-right: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: embed;
+ }
+
+ div {
+ font: 1.25em/1 Ahem;
+ text-align: right;
+ width: 20em;
+ background: navy;
+ color: teal;
+ margin-bottom: 1em;
+ }
+ ]]></style>
+</head>
+
+<body>
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+ <div>
+ First <span>Second</span>
+ </div>
+ <div class="rtol">
+ First <span>Second</span>
+ </div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-040.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-040.xht
new file mode 100644
index 0000000000..54be629e33
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-040.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - padding-right on inline in bidi-override block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-019-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side padding should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ span {
+ color: orange;
+ padding-right: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: bidi-override;
+ }
+
+ div {
+ font: 1.25em/1 Ahem;
+ text-align: right;
+ width: 20em;
+ background: navy;
+ color: teal;
+ margin-bottom: 1em;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+ <div>
+ First <span>Second</span>
+ </div>
+ <div class="rtol">
+ <span>dnoceS</span> tsriF
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-041.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-041.xht
new file mode 100644
index 0000000000..fb2e92b92b
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-041.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - padding-right on normal inline</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-019-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side padding should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ span {
+ color: orange;
+ padding-right: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: normal;
+ }
+
+ div {
+ text-align: right;
+ width: 20em;
+ font: 1.25em/1 Ahem;
+ background: navy;
+ color: teal;
+ margin-bottom: 1em;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+ <div>
+ First <span>Second</span>
+ </div>
+ <div>
+ First <span class="rtol">Second</span>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-042.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-042.xht
new file mode 100644
index 0000000000..9b12479b7b
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-042.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - padding-right on embed inline</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model" />
+ <link rel="match" href="bidi-box-model-019-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side padding should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ span {
+ color: orange;
+ padding-right: 2em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: embed;
+ }
+
+ div {
+ text-align: right;
+ width: 20em;
+ font: 1.25em/1 Ahem;
+ background: navy;
+ color: teal;
+ margin-bottom: 1em;
+ }
+ ]]></style>
+</head>
+
+<body>
+ <p>Test passes if the 2 multi-colored stripes are <strong>identical</strong>.</p>
+ <div>
+ First <span>Second</span>
+ </div>
+ <div>
+ First <span class="rtol">Second</span>
+ </div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-043-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-043-ref.xht
new file mode 100644
index 0000000000..ff5cc84d75
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-043-ref.xht
@@ -0,0 +1,36 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+ <title>CSS Reftest Reference</title>
+
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ div
+ {
+ background-color: navy;
+ line-height: 1.25em;
+ margin-bottom: 1.25em;
+ padding-right: 6.25em;
+ text-align: right;
+ width: 25em;
+ }
+
+ img {vertical-align: top;}
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>Test passes if the 2 bicolored stripes are <strong>identical</strong>.</p>
+
+ <div><img src="support/swatch-orange.png" width="80" height="20" alt="Image download support must be enabled" /></div>
+
+ <div><img src="support/swatch-orange.png" width="80" height="20" alt="Image download support must be enabled" /></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-043.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-043.xht
new file mode 100644
index 0000000000..0c71b3829a
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-043.xht
@@ -0,0 +1,42 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - padding-right on bidi-override block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="match" href="bidi-box-model-043-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side padding should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ div {
+ width: 20em;
+ text-align: right;
+ padding-right: 5em;
+ margin-bottom: 1em;
+ background: navy;
+ font: 1.25em/1 Ahem;
+ color: orange;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: bidi-override;
+ }
+
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 bicolored stripes are <strong>identical</strong>.</p>
+ <div>
+ Text
+ </div>
+ <div class="rtol">
+ txeT
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-044.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-044.xht
new file mode 100644
index 0000000000..6a0ec6cc90
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-044.xht
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - padding-right on normal block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="match" href="bidi-box-model-043-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side padding should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ div {
+ width: 20em;
+ background: navy;
+ color: orange;
+ font: 1.25em/1 Ahem;
+ text-align: right;
+ margin-bottom: 1em;
+ padding-right: 5em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: normal;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 bicolored stripes are <strong>identical</strong>.</p>
+ <div>
+ Text
+ </div>
+ <div class="rtol">
+ Text
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-045.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-045.xht
new file mode 100644
index 0000000000..0e481a0619
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-box-model-045.xht
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: bidirection box model - padding-right on embed block</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-box-model"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#bidi-box-model"/>
+ <link rel="match" href="bidi-box-model-043-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="Side padding should be unaffected by directionality"/>
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ div {
+ width: 20em;
+ background: navy;
+ color: orange;
+ font: 1.25em/1 Ahem;
+ text-align: right;
+ margin-bottom: 1em;
+ padding-right: 5em;
+ }
+
+ .rtol {
+ direction: rtl;
+ unicode-bidi: embed;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 bicolored stripes are <strong>identical</strong>.</p>
+ <div>
+ Text
+ </div>
+ <div class="rtol">
+ Text
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-breaking-001-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-breaking-001-ref.xht
new file mode 100644
index 0000000000..c722fb5199
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-breaking-001-ref.xht
@@ -0,0 +1,103 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+ <title>CSS Reftest Reference</title>
+
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ p + .set {border-top: solid orange;}
+
+ .set
+ {
+ border-bottom: solid orange;
+ clear: both;
+ float: left;
+ }
+
+ .control
+ {
+ border: silver solid;
+ color: blue;
+ float: left;
+ font: bold larger monospace;
+ margin: 1em;
+ padding: 0.25em;
+ }
+
+ /* ensure BDO processing */
+ bdo
+ {
+ direction: ltr;
+ unicode-bidi: bidi-override;
+ }
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>In each pair of silver boxes below, the two patterns must be identical.</p>
+
+ <!--
+ &#x05D0; א is hebrew letter alef
+ &#x05EA; ת is hebrew letter tav
+ -->
+
+ <!-- control for bidi support -->
+ <div class="set">
+ <div class="control">
+ <div><bdo dir="ltr">&#x05D0; &divide; &times; - + &nbsp;</bdo></div>
+ <div><bdo dir="ltr">&nbsp; &divide; &times; - + &#x05EA;</bdo></div>
+ </div>
+ <div class="control">
+ <div><bdo dir="ltr">&#x05D0; &divide; &times; - + &nbsp;</bdo></div>
+ <div><bdo dir="ltr">&nbsp; &divide; &times; - + &#x05EA;</bdo></div>
+ </div>
+ </div>
+
+ <!-- sibling boxes -->
+ <div class="set">
+ <div class="control">
+ <div><bdo dir="ltr">&#x05D0; + - &times; &divide; &nbsp;</bdo></div>
+ <div><bdo dir="ltr">&nbsp; + - &times; &divide; &#x05EA;</bdo></div>
+ </div>
+ <div class="control">
+ <div><bdo dir="ltr">&#x05D0; + - &times; &divide; &nbsp;</bdo></div>
+ <div><bdo dir="ltr">&nbsp; + - &times; &divide; &#x05EA;</bdo></div>
+ </div>
+ </div>
+
+ <!-- anonymous boxes -->
+ <div class="set">
+ <div class="control">
+ <div><bdo dir="ltr">&#x05D0; + - &times; &divide; &nbsp;</bdo></div>
+ <div><bdo dir="ltr">&nbsp; + - &times; &divide; &#x05EA;</bdo></div>
+ </div>
+ <div class="control">
+ <div><bdo dir="ltr">&#x05D0; + - &times; &divide; &nbsp;</bdo></div>
+ <div><bdo dir="ltr">&nbsp; + - &times; &divide; &#x05EA;</bdo></div>
+ </div>
+ </div>
+
+ <!-- anonymous boxes -->
+ <div class="set">
+ <div class="control">
+ <div><bdo dir="ltr">&#x05D0; + - &times; &divide; &nbsp;</bdo></div>
+ <div><bdo dir="ltr">&nbsp; + - &times; &divide; &#x05EA;</bdo></div>
+ </div>
+ <div class="control">
+ <div><bdo dir="ltr">&#x05D0; + - &times; &divide; &nbsp;</bdo></div>
+ <div><bdo dir="ltr">&nbsp; + - &times; &divide; &#x05EA;</bdo></div>
+ </div>
+ </div>
+<!--
+PS &#x2029; Paragraph separator
+LS &#x2028; Line separator
+-->
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-breaking-001.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-breaking-001.xht
new file mode 100644
index 0000000000..85871418ff
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-breaking-001.xht
@@ -0,0 +1,100 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>CSS Test: Bidi paragraph boundaries: Blocks</title>
+ <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-12 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-algo"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction"/>
+ <link rel="match" href="bidi-breaking-001-ref.xht" />
+
+ <meta name="assert" content="Block boundaries break bidi paragraphs."/>
+ <style type="text/css"><![CDATA[
+ /* Make test easier to read */
+ .test, .control {
+ color: blue;
+ font: bold larger monospace;
+ margin: 1em;
+ padding: 0.25em;
+ border: solid silver;
+ float: left;
+ }
+ .set {
+ clear: both;
+ float: left;
+ border-bottom: solid orange;
+ }
+ p + .set {
+ border-top: solid orange;
+ }
+
+ /* ensure BDO processing */
+ bdo {
+ unicode-bidi: bidi-override;
+ direction: ltr;
+ }
+ ]]></style>
+</head>
+<body>
+ <p>In each pair of silver boxes below, the two patterns must be identical.</p>
+
+ <!--
+ &#x05D0; א is hebrew letter alef
+ &#x05EA; ת is hebrew letter tav
+ -->
+
+ <!-- control for bidi support -->
+ <div class="set">
+ <div class="test">
+ <div>&rlm;&nbsp; + - &times; &divide; &#x05D0;</div>
+ <div>&#x05EA; + - &times; &divide; &nbsp;&rlm;</div>
+ </div>
+ <div class="control">
+ <div><bdo dir="ltr">&#x05D0; &divide; &times; - + &nbsp;</bdo></div>
+ <div><bdo dir="ltr">&nbsp; &divide; &times; - + &#x05EA;</bdo></div>
+ </div>
+ </div>
+
+ <!-- sibling boxes -->
+ <div class="set">
+ <div class="test">
+ <div>&#x05D0; + - &times; &divide; &nbsp;</div>
+ <div>&nbsp; + - &times; &divide; &#x05EA;</div>
+ </div>
+ <div class="control">
+ <div><bdo dir="ltr">&#x05D0; + - &times; &divide; &nbsp;</bdo></div>
+ <div><bdo dir="ltr">&nbsp; + - &times; &divide; &#x05EA;</bdo></div>
+ </div>
+ </div>
+
+ <!-- anonymous boxes -->
+ <div class="set">
+ <div class="test">
+ <div>&#x05D0; + - &times; &divide; &nbsp;</div>
+ &nbsp; + - &times; &divide; &#x05EA;
+ </div>
+ <div class="control">
+ <div><bdo dir="ltr">&#x05D0; + - &times; &divide; &nbsp;</bdo></div>
+ <div><bdo dir="ltr">&nbsp; + - &times; &divide; &#x05EA;</bdo></div>
+ </div>
+ </div>
+
+ <!-- anonymous boxes -->
+ <div class="set">
+ <div class="test">
+ &#x05D0; + - &times; &divide; &nbsp;
+ <div></div>
+ &nbsp; + - &times; &divide; &#x05EA;
+ </div>
+ <div class="control">
+ <div><bdo dir="ltr">&#x05D0; + - &times; &divide; &nbsp;</bdo></div>
+ <div><bdo dir="ltr">&nbsp; + - &times; &divide; &#x05EA;</bdo></div>
+ </div>
+ </div>
+<!--
+PS &#x2029; Paragraph separator
+LS &#x2028; Line separator
+-->
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-breaking-002-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-breaking-002-ref.xht
new file mode 100644
index 0000000000..354c16d374
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-breaking-002-ref.xht
@@ -0,0 +1,75 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+ <title>CSS Reftest Reference</title>
+
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ p + .set {border-top: solid orange;}
+
+ .set
+ {
+ border-bottom: solid orange;
+ clear: both;
+ float: left;
+ }
+
+ .control
+ {
+ border: silver solid;
+ color: blue;
+ float: left;
+ font: bold larger monospace;
+ margin: 1em;
+ padding: 0.25em;
+ }
+
+ /* ensure BDO processing */
+ bdo
+ {
+ direction: ltr;
+ unicode-bidi: bidi-override;
+ }
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>In each pair of silver boxes below, the two patterns must be identical.</p>
+
+ <!--
+ &#x05D0; א is hebrew letter alef
+ &#x05EA; ת is hebrew letter tav
+ -->
+
+ <!-- control for bidi support -->
+ <div class="set">
+ <div class="control">
+ <div><bdo dir="ltr">&#x05D0; &divide; &times; - + &nbsp;</bdo></div>
+ <div><bdo dir="ltr">&nbsp; &divide; &times; - + &#x05EA;</bdo></div>
+ </div>
+ <div class="control">
+ <div><bdo dir="ltr">&#x05D0; &divide; &times; - + &nbsp;</bdo></div>
+ <div><bdo dir="ltr">&nbsp; &divide; &times; - + &#x05EA;</bdo></div>
+ </div>
+ </div>
+
+ <!-- preserved source line break breaks bidi paragraph -->
+ <div class="set">
+ <div class="control">
+ <div><bdo dir="ltr">&#x05D0; + - &times; &divide; &nbsp;</bdo></div>
+ <div><bdo dir="ltr">&nbsp; + - &times; &divide; &#x05EA;</bdo></div>
+ </div>
+ <div class="control">
+ <div><bdo dir="ltr">&#x05D0; + - &times; &divide; &nbsp;</bdo></div>
+ <div><bdo dir="ltr">&nbsp; + - &times; &divide; &#x05EA;</bdo></div>
+ </div>
+ </div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-breaking-002.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-breaking-002.xht
new file mode 100644
index 0000000000..b95c668aac
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-breaking-002.xht
@@ -0,0 +1,92 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>CSS Test: Bidi paragraph boundaries: Forced Line Breaks</title>
+ <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-algo"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction"/>
+ <link rel="match" href="bidi-breaking-002-ref.xht" />
+
+ <meta name="assert" content="Forced line breaks of class B (but not class WS)
+ break bidi paragraphs."/>
+ <style type="text/css"><![CDATA[
+ /* Make test easier to read */
+ .test, .control {
+ color: blue;
+ font: bold larger monospace;
+ margin: 1em;
+ padding: 0.25em;
+ border: solid silver;
+ float: left;
+ }
+ .set {
+ clear: both;
+ float: left;
+ border-bottom: solid orange;
+ }
+ p + .set {
+ border-top: solid orange;
+ }
+
+ /* ensure BDO processing */
+ bdo {
+ unicode-bidi: bidi-override;
+ direction: ltr;
+ }
+
+ /* Enable preservation of source line breaks
+ (and PS and LS for certain nonconformant ws-collapsing implementations) */
+ .pre {
+ white-space: pre; white-space: pre-lines;
+ }
+ ]]></style>
+</head>
+<body>
+ <p>In each pair of silver boxes below, the two patterns must be identical.</p>
+
+ <!--
+ &#x05D0; א is hebrew letter alef
+ &#x05EA; ת is hebrew letter tav
+ -->
+
+ <!-- control for bidi support -->
+ <div class="set">
+ <div class="test">
+ <div>&rlm;&nbsp; + - &times; &divide; &#x05D0;</div>
+ <div>&#x05EA; + - &times; &divide; &nbsp;&rlm;</div>
+ </div>
+ <div class="control">
+ <div><bdo dir="ltr">&#x05D0; &divide; &times; - + &nbsp;</bdo></div>
+ <div><bdo dir="ltr">&nbsp; &divide; &times; - + &#x05EA;</bdo></div>
+ </div>
+ </div>
+
+ <!-- preserved source line break breaks bidi paragraph -->
+ <div class="set">
+ <div class="test">
+ <div class="pre">&#x05D0; + - &times; &divide; &nbsp;
+&nbsp; + - &times; &divide; &#x05EA;</div>
+ </div>
+ <div class="control">
+ <div><bdo dir="ltr">&#x05D0; + - &times; &divide; &nbsp;</bdo></div>
+ <div><bdo dir="ltr">&nbsp; + - &times; &divide; &#x05EA;</bdo></div>
+ </div>
+ </div>
+
+ <!-- <br> on shaky ground since HTML4 said it's an LS, but HTML5 will
+ likely side with PS due to better bidi safety; test below as PS for now;
+ move to a separate file when this is resolved in HTML5
+ <div class="set">
+ <div class="test">
+ &#x05D0; + - &times; &divide; &nbsp;<br/>
+ &nbsp; + - &times; &divide; &#x05EA;
+ </div>
+ <div class="control">
+ <div><bdo dir="ltr">&#x05D0; + - &times; &divide; &nbsp;</bdo></div>
+ <div><bdo dir="ltr">&nbsp; + - &times; &divide; &#x05EA;</bdo></div>
+ </div>
+ </div>
+ -->
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-breaking-003-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-breaking-003-ref.xht
new file mode 100644
index 0000000000..0ae7bbc284
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-breaking-003-ref.xht
@@ -0,0 +1,87 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+ <title>CSS Reftest Reference</title>
+
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ p + .set {border-top: solid orange;}
+
+ .set
+ {
+ border-bottom: solid orange;
+ clear: both;
+ float: left;
+ }
+
+ .control
+ {
+ border: silver solid;
+ color: blue;
+ float: left;
+ font: bold larger monospace;
+ margin: 1em;
+ padding: 0.25em;
+ }
+
+ /* ensure BDO processing */
+ bdo
+ {
+ direction: ltr;
+ unicode-bidi: bidi-override;
+ }
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>In each pair of silver boxes below, the two patterns must be identical.</p>
+
+ <!--
+ &#x05D0; א is hebrew letter alef
+ &#x05EA; ת is hebrew letter tav
+ -->
+
+ <!-- control for bidi support -->
+ <div class="set">
+ <div class="control">
+ <div><bdo dir="ltr">&#x05D0; &divide; &times; - + &nbsp;</bdo></div>
+ <div><bdo dir="ltr">&nbsp; &divide; &times; - + &#x05EA;</bdo></div>
+ </div>
+ <div class="control">
+ <div><bdo dir="ltr">&#x05D0; &divide; &times; - + &nbsp;</bdo></div>
+ <div><bdo dir="ltr">&nbsp; &divide; &times; - + &#x05EA;</bdo></div>
+ </div>
+ </div>
+
+ <!-- paragraph separator breaks bidi paragraph -->
+ <div class="set">
+ <div class="control">
+ <div><bdo dir="ltr">&#x05D0; + - &times; &divide; &nbsp;</bdo></div>
+ <div><bdo dir="ltr">&nbsp; + - &times; &divide; &#x05EA;</bdo></div>
+ </div>
+ <div class="control">
+ <div><bdo dir="ltr">&#x05D0; + - &times; &divide; &nbsp;</bdo></div>
+ <div><bdo dir="ltr">&nbsp; + - &times; &divide; &#x05EA;</bdo></div>
+ </div>
+ </div>
+
+ <!-- line separator does not break bidi paragraph -->
+ <div class="set">
+ <div class="control">
+ <div><bdo dir="ltr">&nbsp; &divide; &times; - + &#x05D0;</bdo></div>
+ <div><bdo dir="ltr">&#x05EA; &divide; &times; - + &nbsp;</bdo></div>
+ </div>
+ <div class="control">
+ <div><bdo dir="ltr">&nbsp; &divide; &times; - + &#x05D0;</bdo></div>
+ <div><bdo dir="ltr">&#x05EA; &divide; &times; - + &nbsp;</bdo></div>
+ </div>
+ </div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-breaking-003.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-breaking-003.xht
new file mode 100644
index 0000000000..ffc64873a2
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-breaking-003.xht
@@ -0,0 +1,94 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>CSS Test: Bidi paragraph boundaries: Forced Line Breaks (Unicode)</title>
+ <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
+ <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/>
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-algo"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction"/>
+ <link rel="match" href="bidi-breaking-003-ref.xht" />
+
+ <meta name="flags" content="may"/>
+ <meta name="assert" content="Forced line breaks of class B (but not class WS)
+ break bidi paragraphs."/>
+ <style type="text/css"><![CDATA[
+ /* Make test easier to read */
+ .test, .control {
+ color: blue;
+ font: bold larger monospace;
+ margin: 1em;
+ padding: 0.25em;
+ border: solid silver;
+ float: left;
+ }
+ .set {
+ clear: both;
+ float: left;
+ border-bottom: solid orange;
+ }
+ p + .set {
+ border-top: solid orange;
+ }
+
+ /* ensure BDO processing */
+ bdo {
+ unicode-bidi: bidi-override;
+ direction: ltr;
+ }
+
+ /* Enable preservation of source line breaks
+ (and PS and LS for certain nonconformant ws-collapsing implementations) */
+ .pre {
+ white-space: pre; white-space: pre-lines;
+ }
+ ]]></style>
+</head>
+<body>
+ <p>In each pair of silver boxes below, the two patterns must be identical.</p>
+
+ <!--
+ &#x05D0; א is hebrew letter alef
+ &#x05EA; ת is hebrew letter tav
+ -->
+
+ <!-- control for bidi support -->
+ <div class="set">
+ <div class="test">
+ <div>&rlm;&nbsp; + - &times; &divide; &#x05D0;</div>
+ <div>&#x05EA; + - &times; &divide; &nbsp;&rlm;</div>
+ </div>
+ <div class="control">
+ <div><bdo dir="ltr">&#x05D0; &divide; &times; - + &nbsp;</bdo></div>
+ <div><bdo dir="ltr">&nbsp; &divide; &times; - + &#x05EA;</bdo></div>
+ </div>
+ </div>
+
+ <!-- paragraph separator breaks bidi paragraph -->
+ <div class="set">
+ <div class="test">
+ <div class="pre">&#x05D0; + - &times; &divide; &nbsp;&#x2029;&nbsp; + - &times; &divide; &#x05EA;</div>
+ </div>
+ <div class="control">
+ <div><bdo dir="ltr">&#x05D0; + - &times; &divide; &nbsp;</bdo></div>
+ <div><bdo dir="ltr">&nbsp; + - &times; &divide; &#x05EA;</bdo></div>
+ </div>
+ </div>
+
+ <!-- line separator does not break bidi paragraph -->
+ <div class="set">
+ <div class="test">
+ <div class="pre">&#x05D0; + - &times; &divide; &nbsp;&#x2028;&nbsp; + - &times; &divide; &#x05EA;</div>
+ </div>
+ <div class="control">
+ <div><bdo dir="ltr">&nbsp; &divide; &times; - + &#x05D0;</bdo></div>
+ <div><bdo dir="ltr">&#x05EA; &divide; &times; - + &nbsp;</bdo></div>
+ </div>
+ </div>
+
+<!--
+PS &#x2029; Paragraph separator
+LS &#x2028; Line separator
+-->
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-glyph-mirroring-001-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-glyph-mirroring-001-ref.xht
new file mode 100644
index 0000000000..e54fd147f1
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-glyph-mirroring-001-ref.xht
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+ <title>CSS Reftest Reference</title>
+
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ p.control {text-align: right;}
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>Test passes if the 2 lines are <strong>identical</strong>.</p>
+
+ <p class="control">a b (c d).</p>
+
+ <p class="control">a b (c d).</p>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-glyph-mirroring-001.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-glyph-mirroring-001.xht
new file mode 100644
index 0000000000..6e92d90a86
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-glyph-mirroring-001.xht
@@ -0,0 +1,33 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: unicode-bidi: bidi-override - glyph mirroring</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-14 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-algo"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction"/>
+ <link rel="help" href="http://unicode.org/reports/tr9/#Mirroring"/>
+ <link rel="match" href="bidi-glyph-mirroring-001-ref.xht" />
+
+ <meta name="assert" content="Glyph mirroring of characters with unicode Bidi_Mirrored property should be performed when unicode-bidi: bidi-override is applied"/>
+ <style type="text/css"><![CDATA[
+ .control {
+ text-align: right;
+ }
+ div {
+ direction: rtl;
+ unicode-bidi: bidi-override;
+ }
+ ]]></style>
+ </head>
+ <body>
+
+ <p>Test passes if the 2 lines are <strong>identical</strong>.</p>
+ <p class="control">a b (c d).</p>
+
+ <div>
+ .(d c) b a
+ </div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-glyph-mirroring-002-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-glyph-mirroring-002-ref.xht
new file mode 100644
index 0000000000..7b9bceea11
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-glyph-mirroring-002-ref.xht
@@ -0,0 +1,22 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+ <title>CSS Reftest Reference</title>
+
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ </head>
+
+ <body>
+
+ <p>Test passes if the 2 lines are <strong>identical</strong>.</p>
+
+ <p>(a b &#x05D0;) c d</p>
+
+ <p>(a b &#x05D0;) c d</p>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-glyph-mirroring-002.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-glyph-mirroring-002.xht
new file mode 100644
index 0000000000..1290273e09
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-glyph-mirroring-002.xht
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: unicode-bidi: bidi-override - glyph mirroring</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-14 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-algo"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction"/>
+ <link rel="help" href="http://unicode.org/reports/tr9/#Mirroring"/>
+ <link rel="match" href="bidi-glyph-mirroring-002-ref.xht" />
+
+ <meta name="assert" content="Glyph mirroring of characters with unicode Bidi_Mirrored property should be performed direction:rtl is applied"/>
+ <style type="text/css"><![CDATA[
+ div {
+ direction:rtl;
+ text-align: left;
+ }
+ ]]></style>
+ </head>
+ <body>
+
+ <p>Test passes if the 2 lines are <strong>identical</strong>.</p>
+ <p>(a b &#x05D0;) c d</p>
+
+ <div>
+ c d (&#x05D0; a b)
+ </div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-inline-001-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-inline-001-ref.xht
new file mode 100644
index 0000000000..05d5676a98
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-inline-001-ref.xht
@@ -0,0 +1,22 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+ <title>CSS Reftest Reference</title>
+
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ </head>
+
+ <body>
+
+ <p>Test passes if the 2 lines are <strong>identical</strong>.</p>
+
+ <p>Readable</p>
+
+ <p>Readable</p>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-inline-001.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-inline-001.xht
new file mode 100644
index 0000000000..8a735f4913
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-inline-001.xht
@@ -0,0 +1,25 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: unicode-bidi: bidi-override on inline - rtl</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-14 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-algo"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction"/>
+ <link rel="match" href="bidi-inline-001-ref.xht" />
+
+ <meta name="assert" content="bidi-override should be applied to inlines with no interruptions to surrounding text"/>
+ <style type="text/css"><![CDATA[
+ .rtol {
+ direction: rtl;
+ unicode-bidi: bidi-override;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 lines are <strong>identical</strong>.</p>
+ <p>Readable</p>
+ <p>Re<span class="rtol">bada</span>le</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/bidi-inline-002.xht b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-inline-002.xht
new file mode 100644
index 0000000000..860eb6e555
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/bidi-inline-002.xht
@@ -0,0 +1,29 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: unicode-bidi: bidi-override on inline - nested</title>
+ <link rel="author" title="Eira Monstad, Opera Software ASA" href="mailto:public-testsuites@opera.com"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-14 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#bidi-algo"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction"/>
+ <link rel="match" href="bidi-inline-001-ref.xht" />
+
+ <meta name="assert" content="Nested bidi-override should be applied to inlines with no interruptions to surrounding text"/>
+ <style type="text/css"><![CDATA[
+ .rtol {
+ direction: rtl;
+ unicode-bidi: bidi-override;
+ }
+ .ltor {
+ direction: ltr;
+ unicode-bidi: bidi-override;
+ }
+ ]]></style>
+ </head>
+
+ <body>
+ <p>Test passes if the 2 lines are <strong>identical</strong>.</p>
+ <p>Readable</p>
+ <p><span class="rtol">ba<span class="ltor">ad</span>eR</span>le</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/direction-001-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/direction-001-ref.xht
new file mode 100644
index 0000000000..22ed58fd15
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/direction-001-ref.xht
@@ -0,0 +1,24 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+ <title>CSS Reftest Reference</title>
+
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ div {border: blue solid 2px;}
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>Test passes if "Filler Text" is inside and aligned to the <strong>left side</strong> of hollow blue rectangle.</p>
+
+ <div>Filler Text</div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/direction-001.xht b/testing/web-platform/tests/css/CSS2/bidi-text/direction-001.xht
new file mode 100644
index 0000000000..36a2ec8138
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/direction-001.xht
@@ -0,0 +1,31 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Direction set to 'ltr'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-14 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-001-ref.xht" />
+
+ <meta name="assert" content="The 'direction' property set to 'ltr' sets the direction of an element to left-to-right." />
+ <style type="text/css">
+ #wrapper
+ {
+ direction: rtl;
+ }
+ div div
+ {
+ direction: ltr;
+ border: 2px solid blue;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if "Filler Text" is inside and aligned to the <strong>left side</strong> of hollow blue rectangle.</p>
+ <div id="wrapper">
+ <div>Filler Text</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/direction-002-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/direction-002-ref.xht
new file mode 100644
index 0000000000..f531244fcf
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/direction-002-ref.xht
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+ <title>CSS Reftest Reference</title>
+
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ div
+ {
+ border: blue solid 2px;
+ text-align: right;
+ }
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>Test passes if "Filler Text" is inside and aligned to the <strong>right side</strong> of hollow blue rectangle.</p>
+
+ <div>Filler Text</div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/direction-002.xht b/testing/web-platform/tests/css/CSS2/bidi-text/direction-002.xht
new file mode 100644
index 0000000000..bddc48b7d7
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/direction-002.xht
@@ -0,0 +1,25 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Direction set to 'rtl'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-14 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-002-ref.xht" />
+
+ <meta name="assert" content="The 'direction' property set to 'rtl' sets the direction of an element to right-to-left." />
+ <style type="text/css">
+ div
+ {
+ direction: rtl;
+ border: 2px solid blue;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if "Filler Text" is inside and aligned to the <strong>right side</strong> of hollow blue rectangle.</p>
+ <div>Filler Text</div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/direction-003.xht b/testing/web-platform/tests/css/CSS2/bidi-text/direction-003.xht
new file mode 100644
index 0000000000..10c87ed07f
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/direction-003.xht
@@ -0,0 +1,35 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Direction set to 'inherit' sets a value that is inherited from parent element</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-14 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-002-ref.xht" />
+
+ <meta name="assert" content="The 'direction' property set to 'inherit' sets a direction value to the same as the parent element." />
+ <style type="text/css">
+ div
+ {
+ direction: ltr;
+ }
+ div div
+ {
+ direction: inherit;
+ border: 2px solid blue;
+ }
+ #wrapper
+ {
+ direction: rtl;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if "Filler Text" is inside and aligned to the <strong>right side</strong> of hollow blue rectangle.</p>
+ <div id="wrapper">
+ <div>Filler Text</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-001-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-001-ref.xht
new file mode 100644
index 0000000000..ec6168b598
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-001-ref.xht
@@ -0,0 +1,31 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+ <title>CSS Reftest Reference</title>
+
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ div
+ {
+ background-color: orange;
+ height: 100px;
+ width: 100px;
+ }
+
+ img {vertical-align: top;}
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>Test passes if there is a black square in the <strong>upper-left corner</strong> of the orange square.</p>
+
+ <div><img src="support/black15x15.png" width="50" height="50" alt="Image download support must be enabled" /></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-001.xht b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-001.xht
new file mode 100644
index 0000000000..c6ece60ae7
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-001.xht
@@ -0,0 +1,61 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Direction applied to element with 'display' set to 'table-row-group'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-03 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-applies-to-001-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="The 'direction' property does not apply to elements with a display of 'table-row-group'." />
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css">
+ #test
+ {
+ background: orange;
+ direction: rtl;
+ display: table-row-group;
+ font: 50px/1em Ahem;
+ }
+ #table
+ {
+ display: table;
+ table-layout: fixed;
+ width: 100px;
+ }
+ .row
+ {
+ display: table-row;
+ }
+ .cell
+ {
+ display: table-cell;
+ height: 50px;
+ vertical-align: top;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there is a black square in the <strong>upper-left corner</strong> of the orange square.</p>
+
+ <div id="table">
+
+ <div id="test">
+
+ <div class="row">
+ <div class="cell">a</div><div class="cell"></div>
+ </div>
+
+ <div class="row">
+ <div class="cell"></div><div class="cell"></div>
+ </div>
+
+ </div>
+
+ </div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-002.xht b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-002.xht
new file mode 100644
index 0000000000..5b5e9abe80
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-002.xht
@@ -0,0 +1,61 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Direction applied to element with 'display' set to 'table-header-group'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-03 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-applies-to-001-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="The 'direction' property does not apply to elements with a display of 'table-header-group'." />
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css">
+ #test
+ {
+ background: orange;
+ direction: rtl;
+ display: table-header-group;
+ font: 50px/1em Ahem;
+ }
+ #table
+ {
+ display: table;
+ table-layout: fixed;
+ width: 100px;
+ }
+ .row
+ {
+ display: table-row;
+ }
+ .cell
+ {
+ display: table-cell;
+ height: 50px;
+ vertical-align: top;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there is a black square in the <strong>upper-left corner</strong> of the orange square.</p>
+
+ <div id="table">
+
+ <div id="test">
+
+ <div class="row">
+ <div class="cell">a</div><div class="cell"></div>
+ </div>
+
+ <div class="row">
+ <div class="cell"></div><div class="cell"></div>
+ </div>
+
+ </div>
+
+ </div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-003.xht b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-003.xht
new file mode 100644
index 0000000000..0e6fe5a34c
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-003.xht
@@ -0,0 +1,61 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Direction applied to element with 'display' set to 'table-footer-group'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-03 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-applies-to-001-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="The 'direction' property does not apply to elements with a display of 'table-footer-group'." />
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css">
+ #test
+ {
+ background: orange;
+ direction: rtl;
+ display: table-footer-group;
+ font: 50px/1em Ahem;
+ }
+ #table
+ {
+ display: table;
+ table-layout: fixed;
+ width: 100px;
+ }
+ .row
+ {
+ display: table-row;
+ }
+ .cell
+ {
+ display: table-cell;
+ height: 50px;
+ vertical-align: top;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there is a black square in the <strong>upper-left corner</strong> of the orange square.</p>
+
+ <div id="table">
+
+ <div id="test">
+
+ <div class="row">
+ <div class="cell">a</div><div class="cell"></div>
+ </div>
+
+ <div class="row">
+ <div class="cell"></div><div class="cell"></div>
+ </div>
+
+ </div>
+
+ </div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-004.xht b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-004.xht
new file mode 100644
index 0000000000..7592e170e4
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-004.xht
@@ -0,0 +1,54 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Direction applied to element with 'display' set to 'table-row'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-03 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-applies-to-001-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="The 'direction' property does not apply to elements with a display of 'table-row'." />
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css">
+ .test
+ {
+ background: orange;
+ direction: rtl;
+ display: table-row;
+ font: 50px/1em Ahem;
+ }
+ #table
+ {
+ display: table;
+ table-layout: fixed;
+ width: 100px;
+ }
+
+ .cell
+ {
+ display: table-cell;
+ height: 50px;
+ vertical-align: top;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there is a black square in the <strong>upper-left corner</strong> of the orange square.</p>
+
+ <div id="table">
+
+ <div class="test">
+ <div class="cell">a</div><div class="cell"></div>
+ </div>
+
+ <div class="test">
+ <div class="cell"></div><div class="cell"></div>
+ </div>
+
+ </div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-005.xht b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-005.xht
new file mode 100644
index 0000000000..bed1cbe714
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-005.xht
@@ -0,0 +1,49 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Direction applied to element with 'display' set to 'table-column-group'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-03 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-applies-to-001-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="The 'direction' property does not apply to elements with a display of 'table-column-group'." />
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css">
+ #test
+ {
+ background: orange;
+ direction: rtl;
+ display: table-column-group;
+ }
+ #table
+ {
+ display: table;
+ table-layout: fixed;
+ width: 100px;
+ }
+ #row
+ {
+ display: table-row;
+ }
+ #cell
+ {
+ display: table-cell;
+ font: 50px/1em Ahem;
+ height: 100px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there is a black square in the <strong>upper-left corner</strong> of the orange square.</p>
+ <div id="table">
+ <div id="test"></div>
+ <div id="row">
+ <div id="cell">X</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-006.xht b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-006.xht
new file mode 100644
index 0000000000..217d6f15de
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-006.xht
@@ -0,0 +1,49 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Direction applied to element with 'display' set to 'table-column'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-03 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-applies-to-001-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="The 'direction' property does not apply to elements with a display of 'table-column'." />
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css">
+ #test
+ {
+ background: orange;
+ direction: rtl;
+ display: table-column;
+ }
+ #table
+ {
+ display: table;
+ table-layout: fixed;
+ width: 100px;
+ }
+ #row
+ {
+ display: table-row;
+ }
+ #cell
+ {
+ display: table-cell;
+ font: 50px/1em Ahem;
+ height: 100px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there is a black square in the <strong>upper-left corner</strong> of the orange square.</p>
+ <div id="table">
+ <div id="test"></div>
+ <div id="row">
+ <div id="cell">X</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-007-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-007-ref.xht
new file mode 100644
index 0000000000..c738501173
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-007-ref.xht
@@ -0,0 +1,32 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+ <title>CSS Reftest Reference</title>
+
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ div
+ {
+ background-color: orange;
+ height: 100px;
+ text-align: right;
+ width: 100px;
+ }
+
+ img {vertical-align: top;}
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>Test passes if there is a black square in the <strong>upper-right corner</strong> of the orange square.</p>
+
+ <div><img src="support/black15x15.png" width="50" height="50" alt="Image download support must be enabled" /></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-007.xht b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-007.xht
new file mode 100644
index 0000000000..cc0ca43ee3
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-007.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Direction applied to element with 'display' set to 'table-cell'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-03 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-applies-to-007-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="The 'direction' property applies to elements with a display of 'table-cell'." />
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css">
+ #table
+ {
+ display: table;
+ table-layout: fixed;
+ width: 100px;
+ }
+ #row
+ {
+ display: table-row;
+ }
+ #cell
+ {
+ background: orange;
+ direction: rtl;
+ display: table-cell;
+ font: 50px/1em Ahem;
+ height: 100px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there is a black square in the <strong>upper-right corner</strong> of the orange square.</p>
+ <div id="table">
+ <div id="row">
+ <div id="cell">X</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-008-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-008-ref.xht
new file mode 100644
index 0000000000..9e6844ba73
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-008-ref.xht
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+ <title>CSS Reftest Reference</title>
+
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ </head>
+
+ <body>
+
+ <p>Test passes if there are the words "PASS PASS".</p>
+
+ <div>PASS PASS</div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-008.xht b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-008.xht
new file mode 100644
index 0000000000..0f0f6f5a52
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-008.xht
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Direction applied to element with 'display' set to inline</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-14 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-applies-to-008-ref.xht" />
+
+ <meta name="assert" content="The 'direction' property applies to elements with a display of inline as it can set the direction of embeddings and overrides." />
+ <style type="text/css">
+ div
+ {
+ direction: rtl;
+ display: inline;
+ unicode-bidi: bidi-override;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there are the words "PASS PASS".</p>
+ <div>SSAP SSAP</div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-009.xht b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-009.xht
new file mode 100644
index 0000000000..ea4f001f19
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-009.xht
@@ -0,0 +1,33 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Direction applied to element with 'display' set to block</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-01 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-applies-to-007-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="The 'direction' property applies to elements with a display of block." />
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css">
+ span
+ {
+ background: orange;
+ direction: rtl;
+ display: block;
+ font: 50px/1em Ahem;
+ height: 100px;
+ width: 100px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there is a black square in the <strong>upper-right corner</strong> of the orange square.</p>
+ <div>
+ <span>X</span>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-010.xht b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-010.xht
new file mode 100644
index 0000000000..2b43ed1bbf
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-010.xht
@@ -0,0 +1,33 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Direction applied to element with 'display' set to list-item</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-03 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="The 'direction' property applies to elements with a display of list-item." />
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css">
+ body
+ {
+ margin-left: 1em;
+ }
+ div
+ {
+ background: orange;
+ direction: rtl;
+ display: list-item;
+ font: 50px/1em Ahem;
+ height: 100px;
+ width: 100px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there is a black square in the upper-right corner of an orange square and a marker bullet on the right-hand side of both squares.</p>
+ <div>X</div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-012.xht b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-012.xht
new file mode 100644
index 0000000000..95a0947bb6
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-012.xht
@@ -0,0 +1,33 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Direction applied to element with 'display' set to inline-block</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-03 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-applies-to-007-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="The 'direction' property applies to elements with a display of inline-block." />
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css">
+ div
+ {
+ background: orange;
+ direction: rtl;
+ display: inline-block;
+ font: 50px/1em Ahem;
+ height: 100px;
+ width: 100px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there is a black square in the <strong>upper-right corner</strong> of the orange square.</p>
+
+ <div>X</div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-013.xht b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-013.xht
new file mode 100644
index 0000000000..4f8879bf54
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-013.xht
@@ -0,0 +1,51 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Direction applied to element with 'display' set to 'table'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-14 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-applies-to-007-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="The 'direction' property can apply to elements with a display of 'table' as it specifies the direction of table column layout." />
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css">
+ #table
+ {
+ background: orange;
+ direction: rtl;
+ display: table;
+ table-layout: fixed;
+ font: 50px/1em Ahem;
+ width: 100px;
+ }
+ .row
+ {
+ display: table-row;
+ }
+ .cell
+ {
+ display: table-cell;
+ height: 50px;
+ vertical-align: top;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there is a black square in the <strong>upper-right corner</strong> of the orange square.</p>
+
+ <div id="table">
+ <div class="row">
+ <div class="cell">X</div><div class="cell"></div>
+ </div>
+
+ <div class="row">
+ <div class="cell"></div><div class="cell"></div>
+ </div>
+ </div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-014.xht b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-014.xht
new file mode 100644
index 0000000000..a74c343853
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-014.xht
@@ -0,0 +1,51 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Direction applied to element with 'display' set to 'inline-table'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-14 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-applies-to-007-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="The 'direction' property can apply to elements with a display of 'inline-table' as it specifies the direction of table column layout." />
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css">
+ #table
+ {
+ background: orange;
+ direction: rtl;
+ display: inline-table;
+ table-layout: fixed;
+ font: 50px/1em Ahem;
+ width: 100px;
+ }
+ .row
+ {
+ display: table-row;
+ }
+ .cell
+ {
+ display: table-cell;
+ height: 50px;
+ vertical-align: top;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there is a black square in the <strong>upper-right corner</strong> of the orange square.</p>
+
+ <div id="table">
+ <div class="row">
+ <div class="cell">X</div><div class="cell"></div>
+ </div>
+
+ <div class="row">
+ <div class="cell"></div><div class="cell"></div>
+ </div>
+ </div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-015.xht b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-015.xht
new file mode 100644
index 0000000000..053ee7855e
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/direction-applies-to-015.xht
@@ -0,0 +1,48 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Direction applied to element with 'display' set to 'table-caption'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-14 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-direction" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-applies-to-007-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <meta name="assert" content="The 'direction' property applies to elements with a display of 'table-caption'." />
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css">
+ #caption
+ {
+ background: orange;
+ direction: rtl;
+ display: table-caption;
+ font: 50px/1em Ahem;
+ height: 100px;
+ width: 100px;
+ }
+ #table
+ {
+ display: table;
+ }
+ #row
+ {
+ display: table-row;
+ }
+ #cell
+ {
+ display: table-cell;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there is a black square in the <strong>upper-right corner</strong> of the orange square.</p>
+ <div id="table">
+ <div id="caption">X</div>
+ <div id="row">
+ <div id="cell"></div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/line-breaking-bidi-001-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/line-breaking-bidi-001-ref.xht
new file mode 100644
index 0000000000..ced37606f1
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/line-breaking-bidi-001-ref.xht
@@ -0,0 +1,36 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+
+ <title>CSS Reftest Reference</title>
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ div
+ {
+ color: green;
+ font: 1.25em/1 Ahem;
+ margin: 1em 0;
+ }
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>Test passes if there are only 4 very long green bars and <strong>no red</strong>.</p>
+
+<div>123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890</div>
+
+<div>123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890</div>
+
+<div>123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890</div>
+
+<div>123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890</div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/line-breaking-bidi-001.xht b/testing/web-platform/tests/css/CSS2/bidi-text/line-breaking-bidi-001.xht
new file mode 100644
index 0000000000..f02f5423a1
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/line-breaking-bidi-001.xht
@@ -0,0 +1,38 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+ <head>
+
+ <title>CSS Test: Line breaking and the bidi algorithm</title>
+ <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-14 -->
+ <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/text/white-space/normal/line-breaking/bidi/001.html" type="text/html"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#white-space-model" />
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-processing" />
+ <link rel="match" href="line-breaking-bidi-001-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css">
+ .test { color: green; background: red; font: 1.25em/1 Ahem; white-space: normal; }
+ </style>
+ </head>
+ <body>
+
+ <p>Test passes if there are only 4 very long green bars and <strong>no red</strong>.</p>
+ <p class="test"> xxxxxxxxxxxxxxxxxxxx&#x202A;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx&#x202A;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx&#x202A;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx&#x202A;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx </p>
+ <p class="test"> xxxxxxxxxxxxxxxxxxxx&#x202B;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx&#x202B;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx&#x202B;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx&#x202B;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx </p>
+ <p class="test"> xxxxxxxxxxxxxxxxxxxx&#x202D;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx&#x202D;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx&#x202D;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx&#x202D;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx </p>
+ <p class="test"> xxxxxxxxxxxxxxxxxxxx&#x202E;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx&#x202E;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx&#x202E;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx&#x202E;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx </p>
+
+ <!--
+Char
+name Unicode Function Equivalent Markup
+LRE U+202A Left-to-Right Embedding DIR attribute e.g. DIR="LTR"
+RLE U+202B Right-to-Left Embedding DIR attribute e.g. DIR="RTL"
+PDF U+202C Pop Directional Format No Equivalent </BDO> ends override
+LRO U+202D Left-to-Right Override BDO Element e.g. <BDO dir="LTR">
+RLO U+202E Right-to-Left Override BDO Element e.g. <BDO dir="RTL">
+ -->
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/line-breaking-bidi-002-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/line-breaking-bidi-002-ref.xht
new file mode 100644
index 0000000000..3b09c41bf6
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/line-breaking-bidi-002-ref.xht
@@ -0,0 +1,36 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+
+ <title>CSS Reftest Reference</title>
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css"><![CDATA[
+ div
+ {
+ color: green;
+ font: 1.25em/1 Ahem;
+ margin: 1em 0;
+ }
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>Test passes if there are only 4 very long green bars and <strong>no red</strong>. (Force bidi: &#x05D0;)</p>
+
+<div>123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890</div>
+
+<div>123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890</div>
+
+<div>123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890</div>
+
+<div>123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890</div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/line-breaking-bidi-002.xht b/testing/web-platform/tests/css/CSS2/bidi-text/line-breaking-bidi-002.xht
new file mode 100644
index 0000000000..29662558a0
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/line-breaking-bidi-002.xht
@@ -0,0 +1,38 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+ <head>
+
+ <title>CSS Test: Line breaking and the bidi algorithm (with hebrew character)</title>
+ <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-14 -->
+ <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/text/white-space/normal/line-breaking/bidi/002.html" type="text/html"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#white-space-model" />
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-processing" />
+ <link rel="match" href="line-breaking-bidi-002-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css">
+ .test { color: green; background: red; font: 1.25em/1 Ahem; white-space: normal; }
+ </style>
+ </head>
+ <body>
+
+ <p>Test passes if there are only 4 very long green bars and <strong>no red</strong>. (Force bidi: &#x05D0;)</p>
+ <p class="test"> xxxxxxxxxxxxxxxxxxxx&#x202A;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx&#x202A;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx&#x202A;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx&#x202A;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx </p>
+ <p class="test"> xxxxxxxxxxxxxxxxxxxx&#x202B;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx&#x202B;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx&#x202B;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx&#x202B;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx </p>
+ <p class="test"> xxxxxxxxxxxxxxxxxxxx&#x202D;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx&#x202D;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx&#x202D;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx&#x202D;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx </p>
+ <p class="test"> xxxxxxxxxxxxxxxxxxxx&#x202E;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx&#x202E;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx&#x202E;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx&#x202E;xxxxxxxxxxxxxxxxxxxx&#x202C;xxxxxxxxxxxxxxxxxxxx </p>
+
+ <!--
+Char
+name Unicode Function Equivalent Markup
+LRE U+202A Left-to-Right Embedding DIR attribute e.g. DIR="LTR"
+RLE U+202B Right-to-Left Embedding DIR attribute e.g. DIR="RTL"
+PDF U+202C Pop Directional Format No Equivalent </BDO> ends override
+LRO U+202D Left-to-Right Override BDO Element e.g. <BDO dir="LTR">
+RLO U+202E Right-to-Left Override BDO Element e.g. <BDO dir="RTL">
+ -->
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/line-breaking-bidi-003-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/line-breaking-bidi-003-ref.xht
new file mode 100644
index 0000000000..ec8545c5b4
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/line-breaking-bidi-003-ref.xht
@@ -0,0 +1,31 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+
+ <title>CSS Reftest Reference</title>
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ div
+ {
+ background-color: lime;
+ border: solid;
+ font-size: 2.5em;
+ height: 1em;
+ width: 17em;
+ }
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>There should be no red below, just one unbroken bar of green. (Force bidi: &#x05D0;)</p>
+
+ <div></div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/line-breaking-bidi-003.xht b/testing/web-platform/tests/css/CSS2/bidi-text/line-breaking-bidi-003.xht
new file mode 100644
index 0000000000..9726f32636
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/line-breaking-bidi-003.xht
@@ -0,0 +1,36 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+ <head>
+
+ <title>CSS Test: Line breaking and the bidi algorithm (no breaks)</title>
+ <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-14 -->
+ <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/text/white-space/normal/line-breaking/bidi/003.html" type="text/html"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#white-space-model" />
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-processing" />
+ <link rel="match" href="line-breaking-bidi-003-ref.xht" />
+
+ <meta name="flags" content="ahem" />
+ <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
+ <style type="text/css">
+ .test { font: 40px/1 Ahem; border: solid; width: 17em; background: red; }
+ .test > span { background: lime; }
+ </style>
+ </head>
+ <body>
+
+ <p> There should be no red below, just one unbroken bar of green. (Force bidi: &#x05D0;) </p>
+ <div class="test"><span>&nbsp;&nbsp;&#x202E;&nbsp;&#x202D;&nbsp;&#x202E;&nbsp;&#x202D;&nbsp;&#x202E;&nbsp;&nbsp;&#x202D;&nbsp;&#x202C;&nbsp;<span>&nbsp;</span>&#x202C;&nbsp;&#x202C;&nbsp;&#x202C;&nbsp;&#x202C;&nbsp;&nbsp;&#x202C;&nbsp;</span></div>
+
+ <!--
+Char
+name Unicode Function Equivalent Markup
+LRE U+202A Left-to-Right Embedding DIR attribute e.g. DIR="LTR"
+RLE U+202B Right-to-Left Embedding DIR attribute e.g. DIR="RTL"
+PDF U+202C Pop Directional Format No Equivalent </BDO> ends override
+LRO U+202D Left-to-Right Override BDO Element e.g. <BDO dir="LTR">
+RLO U+202E Right-to-Left Override BDO Element e.g. <BDO dir="RTL">
+ -->
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/1x1-green.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/1x1-green.png
new file mode 100644
index 0000000000..b98ca0ba0a
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/1x1-green.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/1x1-lime.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/1x1-lime.png
new file mode 100644
index 0000000000..cb397fb090
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/1x1-lime.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/1x1-maroon.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/1x1-maroon.png
new file mode 100644
index 0000000000..3f86b07219
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/1x1-maroon.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/1x1-navy.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/1x1-navy.png
new file mode 100644
index 0000000000..9b9a03955b
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/1x1-navy.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/1x1-red.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/1x1-red.png
new file mode 100644
index 0000000000..6bd73ac101
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/1x1-red.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/1x1-white.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/1x1-white.png
new file mode 100644
index 0000000000..dd43faec54
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/1x1-white.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/60x60-gg-rr.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/60x60-gg-rr.png
new file mode 100644
index 0000000000..84f5b2a4f1
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/60x60-gg-rr.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/60x60-green.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/60x60-green.png
new file mode 100644
index 0000000000..b3c8cf3eb4
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/60x60-green.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/a-green.css b/testing/web-platform/tests/css/CSS2/bidi-text/support/a-green.css
new file mode 100644
index 0000000000..b0dbb071d5
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/a-green.css
@@ -0,0 +1 @@
+.a { color: green; }
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/b-green.css b/testing/web-platform/tests/css/CSS2/bidi-text/support/b-green.css
new file mode 100644
index 0000000000..a0473f5ca2
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/b-green.css
@@ -0,0 +1 @@
+.b { color: green; } \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/black15x15.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/black15x15.png
new file mode 100644
index 0000000000..b1bbef2cd5
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/black15x15.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/blue15x15.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/blue15x15.png
new file mode 100644
index 0000000000..89de32fdb8
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/blue15x15.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/c-red.css b/testing/web-platform/tests/css/CSS2/bidi-text/support/c-red.css
new file mode 100644
index 0000000000..d4ba5c64e9
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/c-red.css
@@ -0,0 +1 @@
+.c { color: red; } \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/cat.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/cat.png
new file mode 100644
index 0000000000..85dd732481
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/cat.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/diamond.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/diamond.png
new file mode 100644
index 0000000000..51112efc7c
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/diamond.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/green15x15.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/green15x15.png
new file mode 100644
index 0000000000..51741584a0
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/green15x15.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/pattern-grg-rgr-grg.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/pattern-grg-rgr-grg.png
new file mode 100644
index 0000000000..9b88fbd811
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/pattern-grg-rgr-grg.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/pattern-grg-rrg-rgg.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/pattern-grg-rrg-rgg.png
new file mode 100644
index 0000000000..fcf4f3fd7d
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/pattern-grg-rrg-rgg.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/pattern-rgr-grg-rgr.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/pattern-rgr-grg-rgr.png
new file mode 100644
index 0000000000..d454e3a630
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/pattern-rgr-grg-rgr.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/pattern-tr.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/pattern-tr.png
new file mode 100644
index 0000000000..8b4b25364e
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/pattern-tr.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/ring.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/ring.png
new file mode 100644
index 0000000000..061bb94eba
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/ring.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/square-purple.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/square-purple.png
new file mode 100644
index 0000000000..0f522d7872
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/square-purple.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/square-teal.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/square-teal.png
new file mode 100644
index 0000000000..e567f51b91
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/square-teal.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/square-white.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/square-white.png
new file mode 100644
index 0000000000..5853cbb238
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/square-white.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-blue.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-blue.png
new file mode 100644
index 0000000000..bf2759634d
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-blue.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-green.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-green.png
new file mode 100644
index 0000000000..0aa79b0c86
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-green.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-lime.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-lime.png
new file mode 100644
index 0000000000..55fd7fdaed
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-lime.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-orange.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-orange.png
new file mode 100644
index 0000000000..d3cd498b52
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-orange.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-red.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-red.png
new file mode 100644
index 0000000000..1caf25c992
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-red.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-teal.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-teal.png
new file mode 100644
index 0000000000..0293ce89de
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-teal.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-white.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-white.png
new file mode 100644
index 0000000000..1a7d4323d7
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-white.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-yellow.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-yellow.png
new file mode 100644
index 0000000000..1591aa0e2e
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/swatch-yellow.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/test-bl.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/test-bl.png
new file mode 100644
index 0000000000..904e24e996
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/test-bl.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/test-br.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/test-br.png
new file mode 100644
index 0000000000..f413ff5c1a
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/test-br.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/test-outer.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/test-outer.png
new file mode 100644
index 0000000000..82eeace7fc
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/test-outer.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/test-tl.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/test-tl.png
new file mode 100644
index 0000000000..f6ac0ef7e8
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/test-tl.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/support/test-tr.png b/testing/web-platform/tests/css/CSS2/bidi-text/support/test-tr.png
new file mode 100644
index 0000000000..59843ae54b
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/support/test-tr.png
Binary files differ
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-001.xht b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-001.xht
new file mode 100644
index 0000000000..ab1a497a6a
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-001.xht
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Unicode-bidi set to 'normal'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-14 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-002-ref.xht" />
+
+ <meta name="assert" content="The property 'unicode-bidi' set to 'normal' doesn't modify the directionality of text." />
+ <style type="text/css">
+ div
+ {
+ direction: rtl;
+ unicode-bidi: normal;
+ border: 2px solid blue;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if "Filler Text" is inside and aligned to the <strong>right side</strong> of hollow blue rectangle.</p>
+ <div>Filler Text</div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-002-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-002-ref.xht
new file mode 100644
index 0000000000..012c1ebaae
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-002-ref.xht
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+ <title>CSS Reftest Reference</title>
+
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ div
+ {
+ border: blue solid 2px;
+ text-align: right;
+ }
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>Test passes if the letters below are in alphabetic order.</p>
+
+ <div>AB C DEF GH IJ K</div>
+
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-002.xht b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-002.xht
new file mode 100644
index 0000000000..f3eb0d09fc
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-002.xht
@@ -0,0 +1,29 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Unicode-bidi set to 'embed'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-14 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="unicode-bidi-002-ref.xht" />
+
+ <meta name="assert" content="The property 'unicode-bidi' set to 'embed' opens a new level of embedding in the Unicode bi-directional algorithm." />
+ <style type="text/css">
+ span
+ {
+ unicode-bidi: embed;
+ }
+ div
+ {
+ border: 2px solid blue;
+ direction: rtl;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if the letters below are in alphabetic order.</p>
+ <div>IJ K <span>DEF GH</span> AB C</div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-003.xht b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-003.xht
new file mode 100644
index 0000000000..0f2395ce9d
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-003.xht
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Unicode-bidi set to 'bidi-override'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-14 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-002-ref.xht" />
+
+ <meta name="assert" content="The property 'unicode-bidi' set to 'bidi-override' overrides the directionality of text." />
+ <style type="text/css">
+ div
+ {
+ direction: rtl;
+ unicode-bidi: bidi-override;
+ border: 2px solid blue;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if "Filler Text" is inside and aligned to the <strong>right side</strong> of hollow blue rectangle.</p>
+ <div>txeT relliF</div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-004.xht b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-004.xht
new file mode 100644
index 0000000000..a01c1618fb
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-004.xht
@@ -0,0 +1,32 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Unicode-bidi set to 'inherit'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-14 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-002-ref.xht" />
+
+ <meta name="assert" content="The property 'unicode-bidi' set to 'inherit' sets a value the same as parent element's value." />
+ <style type="text/css">
+ #div1
+ {
+ unicode-bidi: bidi-override;
+ }
+ div div
+ {
+ direction: rtl;
+ unicode-bidi: inherit;
+ border: 2px solid blue;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if "Filler Text" is inside and aligned to the <strong>right side</strong> of hollow blue rectangle.</p>
+ <div id="div1">
+ <div>txeT relliF</div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-001.xht b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-001.xht
new file mode 100644
index 0000000000..882cbd5442
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-001.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Unicode-bidi applied to element with 'display' set to 'table-row-group'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-03 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-applies-to-008-ref.xht" />
+
+ <meta name="assert" content="The 'unicode-bidi' property does not apply to elements with a display of 'table-row-group'. 'unicode-bidi' property only applies to inline elements or block containers' immediate inline-level descendants." />
+ <style type="text/css">
+ #test
+ {
+ direction: rtl;
+ display: table-row-group;
+ unicode-bidi: bidi-override;
+ }
+ #table
+ {
+ display: table;
+ }
+ #row
+ {
+ display: table-row;
+ }
+ #cell
+ {
+ display: table-cell;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there are the words "PASS PASS".</p>
+ <div id="table">
+ <div id="test">
+ <div id="row">
+ <div id="cell">PASS PASS</div>
+ </div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-002.xht b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-002.xht
new file mode 100644
index 0000000000..3abdbcb434
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-002.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Unicode-bidi applied to element with 'display' set to 'table-header-group'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-03 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-applies-to-008-ref.xht" />
+
+ <meta name="assert" content="The 'unicode-bidi' property does not apply to elements with a display of 'table-header-group'. 'unicode-bidi' property only applies to inline elements or block containers' immediate inline-level descendants." />
+ <style type="text/css">
+ #test
+ {
+ direction: rtl;
+ display: table-header-group;
+ unicode-bidi: bidi-override;
+ }
+ #table
+ {
+ display: table;
+ }
+ #row
+ {
+ display: table-row;
+ }
+ #cell
+ {
+ display: table-cell;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there are the words "PASS PASS".</p>
+ <div id="table">
+ <div id="test">
+ <div id="row">
+ <div id="cell">PASS PASS</div>
+ </div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-003.xht b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-003.xht
new file mode 100644
index 0000000000..afc468ecb7
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-003.xht
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Unicode-bidi applied to element with 'display' set to 'table-footer-group'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-03 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-applies-to-008-ref.xht" />
+
+ <meta name="assert" content="The 'unicode-bidi' property does not apply to elements with a display of 'table-footer-group'. 'unicode-bidi' property only applies to inline elements or block containers' immediate inline-level descendants." />
+ <style type="text/css">
+ #test
+ {
+ direction: rtl;
+ display: table-footer-group;
+ unicode-bidi: bidi-override;
+ }
+ #table
+ {
+ display: table;
+ }
+ #row
+ {
+ display: table-row;
+ }
+ #cell
+ {
+ display: table-cell;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there are the words "PASS PASS".</p>
+ <div id="table">
+ <div id="test">
+ <div id="row">
+ <div id="cell">PASS PASS</div>
+ </div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-004.xht b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-004.xht
new file mode 100644
index 0000000000..df78d22a8f
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-004.xht
@@ -0,0 +1,38 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Unicode-bidi applied to element with 'display' set to 'table-row'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-03 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-applies-to-008-ref.xht" />
+
+ <meta name="assert" content="The 'unicode-bidi' property does not apply to elements with a display of 'table-row'. 'unicode-bidi' property only applies to inline elements or block containers' immediate inline-level descendants." />
+ <style type="text/css">
+ #test
+ {
+ direction: rtl;
+ display: table-row;
+ unicode-bidi: bidi-override;
+ }
+ #table
+ {
+ display: table;
+ }
+ #cell
+ {
+ display: table-cell;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there are the words "PASS PASS".</p>
+ <div id="table">
+ <div id="test">
+ <div id="cell">PASS PASS</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-005.xht b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-005.xht
new file mode 100644
index 0000000000..2d6eb77370
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-005.xht
@@ -0,0 +1,43 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Unicode-bidi applied to element with 'display' set to 'table-column-group'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-14 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-applies-to-008-ref.xht" />
+
+ <meta name="assert" content="The 'unicode-bidi' property does not apply to elements with a display of 'table-column-group'. 'unicode-bidi' property only applies to inline elements or block containers' immediate inline-level descendants." />
+ <style type="text/css">
+ #test
+ {
+ direction: rtl;
+ display: table-column-group;
+ unicode-bidi: bidi-override;
+ }
+ #table
+ {
+ display: table;
+ }
+ #row
+ {
+ display: table-row;
+ }
+ #cell
+ {
+ display: table-cell;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there are the words "PASS PASS".</p>
+ <div id="table">
+ <div id="test"></div>
+ <div id="row">
+ <div id="cell">PASS PASS</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-006.xht b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-006.xht
new file mode 100644
index 0000000000..12cb2a9124
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-006.xht
@@ -0,0 +1,43 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Unicode-bidi applied to element with 'display' set to 'table-column'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-14 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-applies-to-008-ref.xht" />
+
+ <meta name="assert" content="The 'unicode-bidi' property does not apply to elements with a display of 'table-column'. 'unicode-bidi' property only applies to inline elements or block containers' immediate inline-level descendants." />
+ <style type="text/css">
+ #test
+ {
+ direction: rtl;
+ display: table-column;
+ unicode-bidi: bidi-override;
+ }
+ #table
+ {
+ display: table;
+ }
+ #row
+ {
+ display: table-row;
+ }
+ #cell
+ {
+ display: table-cell;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there are the words "PASS PASS".</p>
+ <div id="table">
+ <div id="test"></div>
+ <div id="row">
+ <div id="cell">PASS PASS</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-007.xht b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-007.xht
new file mode 100644
index 0000000000..46dd1dad09
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-007.xht
@@ -0,0 +1,38 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Unicode-bidi applied to element with 'display' set to 'table-cell'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-14 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-applies-to-008-ref.xht" />
+
+ <meta name="assert" content="The 'unicode-bidi' property applies to elements with a display of 'table-cell'." />
+ <style type="text/css">
+ #table
+ {
+ display: table;
+ }
+ #row
+ {
+ display: table-row;
+ }
+ #test
+ {
+ direction: rtl;
+ display: table-cell;
+ unicode-bidi: bidi-override;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there are the words "PASS PASS".</p>
+ <div id="table">
+ <div id="row">
+ <div id="test">SSAP SSAP</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-008.xht b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-008.xht
new file mode 100644
index 0000000000..07b669445c
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-008.xht
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Unicode-bidi applied to element with 'display' set to inline</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-14 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-applies-to-008-ref.xht" />
+
+ <meta name="assert" content="The 'unicode-bidi' property applies to elements with a display of inline." />
+ <style type="text/css">
+ div
+ {
+ direction: rtl;
+ display: inline;
+ unicode-bidi: bidi-override;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there are the words "PASS PASS".</p>
+ <div>SSAP SSAP</div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-009-ref.xht b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-009-ref.xht
new file mode 100644
index 0000000000..c1f0dc6b78
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-009-ref.xht
@@ -0,0 +1,24 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+ <title>CSS Reftest Reference</title>
+
+ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+ <style type="text/css"><![CDATA[
+ div {text-align: right;}
+ ]]></style>
+
+ </head>
+
+ <body>
+
+ <p>Test passes if there are the words "PASS PASS" on the right-hand side of the page.</p>
+
+ <div>PASS PASS</div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-009.xht b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-009.xht
new file mode 100644
index 0000000000..d9d72de67b
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-009.xht
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Unicode-bidi applied to element with 'display' set to block</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-14 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="unicode-bidi-applies-to-009-ref.xht" />
+
+ <meta name="assert" content="The 'unicode-bidi' property applies to elements with a display of block." />
+ <style type="text/css">
+ span
+ {
+ direction: rtl;
+ display: block;
+ unicode-bidi: bidi-override;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there are the words "PASS PASS" on the right-hand side of the page.</p>
+ <div>
+ <span>SSAP SSAP</span>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-010.xht b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-010.xht
new file mode 100644
index 0000000000..9cd7b9be09
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-010.xht
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Unicode-bidi applied to element with 'display' set to list-item</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-14 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <meta name="assert" content="The 'unicode-bidi' property applies to elements with a display of list-item." />
+ <style type="text/css">
+ body
+ {
+ margin-right: 50px;
+ }
+ div
+ {
+ direction: rtl;
+ display: list-item;
+ unicode-bidi: bidi-override;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there are the words "PASS PASS" with a marker bullet on its right-hand side.</p>
+ <div>SSAP SSAP</div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-012.xht b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-012.xht
new file mode 100644
index 0000000000..95745c1e30
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-012.xht
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Unicode-bidi applied to element with 'display' set to inline-block</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-03-14 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-applies-to-008-ref.xht" />
+
+ <meta name="assert" content="The 'unicode-bidi' property applies to elements with a display of inline-block." />
+ <style type="text/css">
+ div
+ {
+ direction: rtl;
+ display: inline-block;
+ unicode-bidi: bidi-override;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there are the words "PASS PASS".</p>
+ <div>SSAP SSAP</div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-013.xht b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-013.xht
new file mode 100644
index 0000000000..c463057125
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-013.xht
@@ -0,0 +1,38 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Unicode-bidi applied to element with 'display' set to 'table'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-03 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-applies-to-008-ref.xht" />
+
+ <meta name="assert" content="The 'unicode-bidi' property does not apply to elements with a display of 'table'. 'unicode-bidi' property only applies to inline elements or block containers' immediate inline-level descendants." />
+ <style type="text/css">
+ #test
+ {
+ direction: rtl;
+ display: table;
+ unicode-bidi: bidi-override;
+ }
+ #row
+ {
+ display: table-row;
+ }
+ #cell
+ {
+ display: table-cell;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there are the words "PASS PASS".</p>
+ <div id="test">
+ <div id="row">
+ <div id="cell">PASS PASS</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-014.xht b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-014.xht
new file mode 100644
index 0000000000..c120375ccd
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-014.xht
@@ -0,0 +1,38 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Unicode-bidi applied to element with 'display' set to 'inline-table'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-03 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-applies-to-008-ref.xht" />
+
+ <meta name="assert" content="The 'unicode-bidi' property does not apply to elements with a display of 'inline-table'. 'unicode-bidi' property only applies to inline elements or block containers' immediate inline-level descendants." />
+ <style type="text/css">
+ #test
+ {
+ direction: rtl;
+ display: inline-table;
+ unicode-bidi: bidi-override;
+ }
+ #row
+ {
+ display: table-row;
+ }
+ #cell
+ {
+ display: table-cell;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there are the words "PASS PASS".</p>
+ <div id="test">
+ <div id="row">
+ <div id="cell">PASS PASS</div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-015.xht b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-015.xht
new file mode 100644
index 0000000000..62ce16feb4
--- /dev/null
+++ b/testing/web-platform/tests/css/CSS2/bidi-text/unicode-bidi-applies-to-015.xht
@@ -0,0 +1,43 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>CSS Test: Unicode-bidi applied to element with 'display' set to 'table-caption'</title>
+ <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
+ <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-12-03 -->
+ <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-unicode-bidi" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#direction" />
+ <link rel="match" href="direction-applies-to-008-ref.xht" />
+
+ <meta name="assert" content="The 'unicode-bidi' property applies to elements with a display of 'table-caption'." />
+ <style type="text/css">
+ #test
+ {
+ direction: rtl;
+ display: table-caption;
+ unicode-bidi: bidi-override;
+ }
+ #table
+ {
+ display: table;
+ }
+ #row
+ {
+ display: table-row;
+ }
+ #cell
+ {
+ display: table-cell;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Test passes if there are the words "PASS PASS".</p>
+ <div id="table">
+ <div id="test">SSAP&nbsp;SSAP</div>
+ <div id="row">
+ <div id="cell"></div>
+ </div>
+ </div>
+ </body>
+</html>