summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters')
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-001a.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-001b.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-001c.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-002a.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-002b.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-002c.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-003a.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-003b.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-003c.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-004a.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-004b.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-004c.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-005a.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-005b.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-005c.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-006a.html32
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-006b.html32
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-006c.html32
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-007a.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-007b.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-007c.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-008a.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-008b.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-008c.html36
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009a.html33
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009b.html33
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009c.html33
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-001-ref.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-002a-ref.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-002b-ref.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-002c-ref.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-003-ref.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-004-ref.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-005-ref.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-006-ref.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-006c-ref.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-007-ref.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-008-ref.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-009-ref.html16
-rw-r--r--testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-009b-ref.html16
40 files changed, 1159 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-001a.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-001a.html
new file mode 100644
index 0000000000..16a308a2f7
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-001a.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from following number, opposite direction</title>
+<link rel="author" title="Richard Ishida" href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel="match" href='reference/dir-isolation-001-ref.html'>
+<meta name="assert" content='Element content with a dir attribute is treated as a neutral character and directionally isolated from a following number.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="rtl">&#x5d0;</span> 3</div>
+<div dir="ltr"><span dir="rtl">a</span> 3</div>
+<div dir="rtl"><span dir="ltr">&#x5d0;</span> 3</div>
+<div dir="rtl"><span dir="ltr">a</span> 3</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0; 3&#x202c;</div>
+<div dir="ltr">&#x202d;a 3&#x202c;</div>
+<div dir="rtl">&#x202d;3 &#x5d0;&#x202c;</div>
+<div dir="rtl">&#x202d;3 a&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-001b.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-001b.html
new file mode 100644
index 0000000000..197f49aa24
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-001b.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from following number, auto</title>
+<link rel="author" title="Richard Ishida" href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel="match" href='reference/dir-isolation-001-ref.html'>
+<meta name="assert" content='Element content with a dir attribute is treated as a neutral character and directionally isolated from a following number.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="auto">&#x5d0;</span> 3</div>
+<div dir="ltr"><span dir="auto">a</span> 3</div>
+<div dir="rtl"><span dir="auto">&#x5d0;</span> 3</div>
+<div dir="rtl"><span dir="auto">a</span> 3</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0; 3&#x202c;</div>
+<div dir="ltr">&#x202d;a 3&#x202c;</div>
+<div dir="rtl">&#x202d;3 &#x5d0;&#x202c;</div>
+<div dir="rtl">&#x202d;3 a&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-001c.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-001c.html
new file mode 100644
index 0000000000..95ec6c739d
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-001c.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from following number, same direction</title>
+<link rel="author" title="Richard Ishida" href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel="match" href='reference/dir-isolation-001-ref.html'>
+<meta name="assert" content='Element content with a dir attribute is treated as a neutral character and directionally isolated from a following number.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="ltr">&#x5d0;</span> 3</div>
+<div dir="ltr"><span dir="ltr">a</span> 3</div>
+<div dir="rtl"><span dir="rtl">&#x5d0;</span> 3</div>
+<div dir="rtl"><span dir="rtl">a</span> 3</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0; 3&#x202c;</div>
+<div dir="ltr">&#x202d;a 3&#x202c;</div>
+<div dir="rtl">&#x202d;3 &#x5d0;&#x202c;</div>
+<div dir="rtl">&#x202d;3 a&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-002a.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-002a.html
new file mode 100644
index 0000000000..7b7029a269
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-002a.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from following number with intervening neutrals, opposite direction</title>
+<link rel="author" title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-002a-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from a following number.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="rtl">> &#x5d0; ></span> > 3 ></div>
+<div dir="ltr"><span dir="rtl">> a ></span> > 3 ></div>
+<div dir="rtl"><span dir="ltr">> &#x5d0; ></span> > 3 ></div>
+<div dir="rtl"><span dir="ltr">> a ></span> > 3 ></div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&lt; &#x5d0; &lt; &gt; 3 &gt;&#x202c;</div>
+<div dir="ltr">&#x202d;&lt; a &lt; &gt; 3 &gt;&#x202c;</div>
+<div dir="rtl">&#x202d;&lt; 3 &lt; &gt; &#x5d0; &gt;&#x202c;</div>
+<div dir="rtl">&#x202d;&lt; 3 &lt; &gt; a &gt;&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-002b.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-002b.html
new file mode 100644
index 0000000000..d448de5080
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-002b.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from following number with intervening neutrals, auto</title>
+<link rel="author" title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-002b-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from a following number.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="auto">> &#x5d0; ></span> > 3 ></div>
+<div dir="ltr"><span dir="auto">> a ></span> > 3 ></div>
+<div dir="rtl"><span dir="auto">> &#x5d0; ></span> > 3 ></div>
+<div dir="rtl"><span dir="auto">> a ></span> > 3 ></div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&lt; &#x5d0; &lt; &gt; 3 &gt;&#x202c;</div>
+<div dir="ltr">&#x202d;&gt; a &gt; &gt; 3 &gt;&#x202c;</div>
+<div dir="rtl">&#x202d;&lt; 3 &lt; &lt; &#x5d0; &lt;&#x202c;</div>
+<div dir="rtl">&#x202d;&lt; 3 &lt; &gt; a &gt;&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-002c.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-002c.html
new file mode 100644
index 0000000000..e88fb1c845
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-002c.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from following number with intervening neutrals, same direction</title>
+<link rel="author" title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-002c-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from a following number.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="ltr">&gt; &#x5d0; &gt;</span> &gt; 3 &gt;</div>
+<div dir="ltr"><span dir="ltr">&gt; a &gt;</span> &gt; 3 &gt;</div>
+<div dir="rtl"><span dir="rtl">&gt; &#x5d0; &gt;</span> &gt; 3 &gt;</div>
+<div dir="rtl"><span dir="rtl">&gt; a &gt;</span> &gt; 3 &gt;</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&gt; &#x5d0; &gt; &gt; 3 &gt;&#x202c;</div>
+<div dir="ltr">&#x202d;&gt; a &gt; &gt; 3 &gt;&#x202c;</div>
+<div dir="rtl">&#x202d;&lt; 3 &lt; &lt; &#x5d0; &lt;&#x202c;</div>
+<div dir="rtl">&#x202d;&lt; 3 &lt; &lt; a &lt;&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-003a.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-003a.html
new file mode 100644
index 0000000000..9cf65c8184
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-003a.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from immediately following number, opposite direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-003-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and is directionally isolated from a following number, even with no intervening white space.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="rtl">&#x5d0;</span>3</div>
+<div dir="ltr"><span dir="rtl">a</span>3</div>
+<div dir="rtl"><span dir="ltr">&#x5d0;</span>3</div>
+<div dir="rtl"><span dir="ltr">a</span>3</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0;3&#x202c;</div>
+<div dir="ltr">&#x202d;a3&#x202c;</div>
+<div dir="rtl">&#x202d;3&#x5d0;&#x202c;</div>
+<div dir="rtl">&#x202d;3a&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-003b.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-003b.html
new file mode 100644
index 0000000000..2c6b553089
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-003b.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from immediately following number, auto</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-003-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and is directionally isolated from a following number, even with no intervening white space.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="auto">&#x5d0;</span>3</div>
+<div dir="ltr"><span dir="auto">a</span>3</div>
+<div dir="rtl"><span dir="auto">&#x5d0;</span>3</div>
+<div dir="rtl"><span dir="auto">a</span>3</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0;3&#x202c;</div>
+<div dir="ltr">&#x202d;a3&#x202c;</div>
+<div dir="rtl">&#x202d;3&#x5d0;&#x202c;</div>
+<div dir="rtl">&#x202d;3a&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-003c.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-003c.html
new file mode 100644
index 0000000000..ac8735122b
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-003c.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from immediately following number, same direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-003-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and is directionally isolated from a following number, even with no intervening white space.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="ltr">&#x5d0;</span>3</div>
+<div dir="ltr"><span dir="ltr">a</span>3</div>
+<div dir="rtl"><span dir="rtl">&#x5d0;</span>3</div>
+<div dir="rtl"><span dir="rtl">a</span>3</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0;3&#x202c;</div>
+<div dir="ltr">&#x202d;a3&#x202c;</div>
+<div dir="rtl">&#x202d;3&#x5d0;&#x202c;</div>
+<div dir="rtl">&#x202d;3a&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-004a.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-004a.html
new file mode 100644
index 0000000000..27a674ccdc
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-004a.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: numbers isolated from preceding text, opposite direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-004-ref.html'>
+<meta name='assert' content='Numeric element content with a dir attribute is treated as a neutral character and directionally isolated from preceding text.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr">&#x5d0; <span dir="rtl">3</span></div>
+<div dir="ltr">a <span dir="rtl">3</span></div>
+<div dir="rtl">&#x5d0; <span dir="ltr">3</span></div>
+<div dir="rtl">a <span dir="ltr">3</span></div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0; 3&#x202c;</div>
+<div dir="ltr">&#x202d;a 3&#x202c;</div>
+<div dir="rtl">&#x202d;3 &#x5d0;&#x202c;</div>
+<div dir="rtl">&#x202d;3 a&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-004b.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-004b.html
new file mode 100644
index 0000000000..6fe74393ae
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-004b.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: numbers isolated from preceding text, auto</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-004-ref.html'>
+<meta name='assert' content='Numeric element content with a dir attribute is treated as a neutral character and directionally isolated from preceding text.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr">&#x5d0; <span dir="auto">3</span></div>
+<div dir="ltr">a <span dir="auto">3</span></div>
+<div dir="rtl">&#x5d0; <span dir="auto">3</span></div>
+<div dir="rtl">a <span dir="auto">3</span></div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0; 3&#x202c;</div>
+<div dir="ltr">&#x202d;a 3&#x202c;</div>
+<div dir="rtl">&#x202d;3 &#x5d0;&#x202c;</div>
+<div dir="rtl">&#x202d;3 a&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-004c.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-004c.html
new file mode 100644
index 0000000000..43d994b2f0
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-004c.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: numbers isolated from preceding text, same direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-004-ref.html'>
+<meta name='assert' content='Numeric element content with a dir attribute is treated as a neutral character and directionally isolated from preceding text.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr">&#x5d0; <span dir="ltr">3</span></div>
+<div dir="ltr">a <span dir="ltr">3</span></div>
+<div dir="rtl">&#x5d0; <span dir="rtl">3</span></div>
+<div dir="rtl">a <span dir="rtl">3</span></div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0; 3&#x202c;</div>
+<div dir="ltr">&#x202d;a 3&#x202c;</div>
+<div dir="rtl">&#x202d;3 &#x5d0;&#x202c;</div>
+<div dir="rtl">&#x202d;3 a&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-005a.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-005a.html
new file mode 100644
index 0000000000..2fbddbd71f
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-005a.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from following text, opposite direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-005-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from following text.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="rtl">&#x5d0;</span> &#x5d1;...</div>
+<div dir="ltr"><span dir="rtl">a</span> b...</div>
+<div dir="rtl"><span dir="ltr">a</span> b...</div>
+<div dir="rtl"><span dir="ltr">&#x5d0;</span> &#x5d1;...</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0; &#x5d1;...&#x202c;</div>
+<div dir="ltr">&#x202d;a b...&#x202c;</div>
+<div dir="rtl">&#x202d;...b a&#x202c;</div>
+<div dir="rtl">&#x202d;...&#x5d1; &#x5d0;&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-005b.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-005b.html
new file mode 100644
index 0000000000..d61e258f21
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-005b.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from following text, auto</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-005-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from following text.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="auto">&#x5d0;</span> &#x5d1;...</div>
+<div dir="ltr"><span dir="auto">a</span> b...</div>
+<div dir="rtl"><span dir="auto">a</span> b...</div>
+<div dir="rtl"><span dir="auto">&#x5d0;</span> &#x5d1;...</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0; &#x5d1;...&#x202c;</div>
+<div dir="ltr">&#x202d;a b...&#x202c;</div>
+<div dir="rtl">&#x202d;...b a&#x202c;</div>
+<div dir="rtl">&#x202d;...&#x5d1; &#x5d0;&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-005c.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-005c.html
new file mode 100644
index 0000000000..d544275b2f
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-005c.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from following text, same direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-005-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from following text.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="ltr">&#x5d0;</span> &#x5d1;...</div>
+<div dir="ltr"><span dir="ltr">a</span> b...</div>
+<div dir="rtl"><span dir="rtl">a</span> b...</div>
+<div dir="rtl"><span dir="rtl">&#x5d0;</span> &#x5d1;...</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0; &#x5d1;...&#x202c;</div>
+<div dir="ltr">&#x202d;a b...&#x202c;</div>
+<div dir="rtl">&#x202d;...b a&#x202c;</div>
+<div dir="rtl">&#x202d;...&#x5d1; &#x5d0;&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-006a.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-006a.html
new file mode 100644
index 0000000000..430df00d9f
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-006a.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from following text with intervening neutrals, opposite direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-006-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from following text despite intervening neutrals.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="rtl">&gt; &#x5d0; &gt;</span> &gt; &#x5d1; &gt;...</div>
+<div dir="rtl"><span dir="ltr">&gt; a &gt;</span> &gt; b &gt;...</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&lt; &#x5d0; &lt; &gt; &#x5d1; &gt;...&#x202c;</div>
+<div dir="rtl">&#x202d;...&lt; b &lt; &gt; a &gt;&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-006b.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-006b.html
new file mode 100644
index 0000000000..a6da487152
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-006b.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from following text with intervening neutrals, auto</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-006-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from following text despite intervening neutrals.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="auto">&gt; &#x5d0; &gt;</span> &gt; &#x5d1; &gt;...</div>
+<div dir="rtl"><span dir="auto">&gt; a &gt;</span> &gt; b &gt;...</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&lt; &#x5d0; &lt; &gt; &#x5d1; &gt;...&#x202c;</div>
+<div dir="rtl">&#x202d;...&lt; b &lt; &gt; a &gt;&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-006c.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-006c.html
new file mode 100644
index 0000000000..3407d37f38
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-006c.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from following text with intervening neutrals, same direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-006c-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from following text despite intervening neutrals.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="ltr">&gt; &#x5d0; &gt;</span> &gt; &#x5d1; &gt;...</div>
+<div dir="rtl"><span dir="rtl">&gt; a &gt;</span> &gt; b &gt;...</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&gt; &#x5d0; &gt; &gt; &#x5d1; &gt;...&#x202c;</div>
+<div dir="rtl">&#x202d;...&lt; b &lt; &lt; a &lt;&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-007a.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-007a.html
new file mode 100644
index 0000000000..e8b37b1b97
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-007a.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from immediately following text, opposite direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-007-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from following text even with no intervening white space.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="rtl">&#x5d0;</span>&#x5d1;...</div>
+<div dir="ltr"><span dir="rtl">a</span>b...</div>
+<div dir="rtl"><span dir="ltr">a</span>b...</div>
+<div dir="rtl"><span dir="ltr">&#x5d0;</span>&#x5d1;...</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0;&#x5d1;...&#x202c;</div>
+<div dir="ltr">&#x202d;ab...&#x202c;</div>
+<div dir="rtl">&#x202d;...ba&#x202c;</div>
+<div dir="rtl">&#x202d;...&#x5d1;&#x5d0;&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-007b.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-007b.html
new file mode 100644
index 0000000000..c54e63de7c
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-007b.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from immediately following text, auto</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-007-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from following text even with no intervening white space.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="auto">&#x5d0;</span>&#x5d1;...</div>
+<div dir="ltr"><span dir="auto">a</span>b...</div>
+<div dir="rtl"><span dir="auto">a</span>b...</div>
+<div dir="rtl"><span dir="auto">&#x5d0;</span>&#x5d1;...</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0;&#x5d1;...&#x202c;</div>
+<div dir="ltr">&#x202d;ab...&#x202c;</div>
+<div dir="rtl">&#x202d;...ba&#x202c;</div>
+<div dir="rtl">&#x202d;...&#x5d1;&#x5d0;&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-007c.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-007c.html
new file mode 100644
index 0000000000..b9c5219b8d
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-007c.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from immediately following text, same direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-007-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from following text even with no intervening white space.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr"><span dir="ltr">&#x5d0;</span>&#x5d1;...</div>
+<div dir="ltr"><span dir="ltr">a</span>b...</div>
+<div dir="rtl"><span dir="rtl">a</span>b...</div>
+<div dir="rtl"><span dir="rtl">&#x5d0;</span>&#x5d1;...</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0;&#x5d1;...&#x202c;</div>
+<div dir="ltr">&#x202d;ab...&#x202c;</div>
+<div dir="rtl">&#x202d;...ba&#x202c;</div>
+<div dir="rtl">&#x202d;...&#x5d1;&#x5d0;&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-008a.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-008a.html
new file mode 100644
index 0000000000..1455fd552b
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-008a.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from preceding text, opposite direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-008-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from preceding text.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr">&#x5d0; <span dir="rtl">&#x5d1;</span></div>
+<div dir="ltr">a <span dir="rtl">b</span></div>
+<div dir="rtl">&#x5d0; <span dir="ltr">&#x5d1;</span></div>
+<div dir="rtl">a <span dir="ltr">b</span></div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0; &#x5d1;&#x202c;</div>
+<div dir="ltr">&#x202d;a b&#x202c;</div>
+<div dir="rtl">&#x202d;&#x5d1; &#x5d0;&#x202c;</div>
+<div dir="rtl">&#x202d;b a&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-008b.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-008b.html
new file mode 100644
index 0000000000..f12e6d67bf
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-008b.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from preceding text, auto</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-008-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from preceding text.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr">&#x5d0; <span dir="auto">&#x5d1;</span></div>
+<div dir="ltr">a <span dir="auto">b</span></div>
+<div dir="rtl">&#x5d0; <span dir="auto">&#x5d1;</span></div>
+<div dir="rtl">a <span dir="auto">b</span></div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0; &#x5d1;&#x202c;</div>
+<div dir="ltr">&#x202d;a b&#x202c;</div>
+<div dir="rtl">&#x202d;&#x5d1; &#x5d0;&#x202c;</div>
+<div dir="rtl">&#x202d;b a&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-008c.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-008c.html
new file mode 100644
index 0000000000..b1754cf23e
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-008c.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>The dir attribute: isolated from preceding text, same direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-008-ref.html'>
+<meta name='assert' content='Element content with a dir attribute is treated as a neutral character and directionally isolated from preceding text.'>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!--Notes:
+Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+The punctuation is moved around in the source to make it easier to do visual comparisons when the test is run.
+-->
+<div class="test">
+<div dir="ltr">&#x5d0; <span dir="ltr">&#x5d1;</span></div>
+<div dir="ltr">a <span dir="ltr">b</span></div>
+<div dir="rtl">&#x5d0; <span dir="rtl">&#x5d1;</span></div>
+<div dir="rtl">a <span dir="rtl">b</span></div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d0; &#x5d1;&#x202c;</div>
+<div dir="ltr">&#x202d;a b&#x202c;</div>
+<div dir="rtl">&#x202d;&#x5d1; &#x5d0;&#x202c;</div>
+<div dir="rtl">&#x202d;b a&#x202c;</div>
+</div>
+</body></html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009a.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009a.html
new file mode 100644
index 0000000000..63a9706bae
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009a.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from surrounding text, opposite direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-009-ref.html'>
+<meta name='assert' content="Element content with a dir attribute is treated as a neutral character and directionally isolated from surrounding text.">
+<style type='text/css'>
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!-- Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+If the BDI in the test's first DIV were a SPAN, its b would prevent the &#x5d0; and the &#x5d1;
+from forming a single RTL run and thus keep the &gt;s between from being mirrored into &lt;s.
+-->
+<div class="test">
+<div dir="ltr">&#x5d0; &gt; <span dir="rtl">&gt; b &gt;</span> &gt; &#x5d2;...</div>
+<div dir="rtl">a &gt; <span dir="ltr">&gt; &#x5d1; &gt;</span> &gt; c...</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d2; &lt; &lt; b &lt; &lt; &#x5d0;...&#x202c;</div>
+<div dir="rtl">&#x202d;...a &gt; &gt; &#x5d1; &gt; &gt; c&#x202c;</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009b.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009b.html
new file mode 100644
index 0000000000..57098fa75a
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009b.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from surrounding text, auto</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-009b-ref.html'>
+<meta name='assert' content="Element content with a dir attribute is treated as a neutral character and directionally isolated from surrounding text.">
+<style type='text/css'>
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!-- Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+If the BDI in the test's first DIV were a SPAN, its b would prevent the &#x5d0; and the &#x5d1;
+from forming a single RTL run and thus keep the &gt;s between from being mirrored into &lt;s.
+-->
+<div class="test">
+<div dir="ltr">&#x5d0; &gt; <span dir="auto">&gt; b &gt;</span> &gt; &#x5d2;...</div>
+<div dir="rtl">a &gt; <span dir="auto">&gt; &#x5d1; &gt;</span> &gt; c...</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d2; &lt; &gt; b &gt; &lt; &#x5d0;...&#x202c;</div>
+<div dir="rtl">&#x202d;...a &gt; &lt; &#x5d1; &lt; &gt; c&#x202c;</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009c.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009c.html
new file mode 100644
index 0000000000..4aac3184ee
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009c.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from surrounding text, same direction</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="help" href='http://www.w3.org/TR/html5/dom.html#requirements-relating-to-the-bidirectional-algorithm'>
+<link rel='match' href='reference/dir-isolation-009b-ref.html'>
+<meta name='assert' content="Element content with a dir attribute is treated as a neutral character and directionally isolated from surrounding text.">
+<style type='text/css'>
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<!-- Key to entities used below:
+&#x5d0; ... &#x5d5; - The first six Hebrew letters (strongly RTL).
+&#x202d; - The LRO (left-to-right-override) formatting character.
+&#x202c; - The PDF (pop directional formatting) formatting character; closes LRO.
+If the BDI in the test's first DIV were a SPAN, its b would prevent the &#x5d0; and the &#x5d1;
+from forming a single RTL run and thus keep the &gt;s between from being mirrored into &lt;s.
+-->
+<div class="test">
+<div dir="ltr">&#x5d0; &gt; <span dir="ltr">&gt; b &gt;</span> &gt; &#x5d2;...</div>
+<div dir="rtl">a &gt; <span dir="rtl">&gt; &#x5d1; &gt;</span> &gt; c...</div>
+</div>
+<div class="ref">
+<div dir="ltr">&#x202d;&#x5d2; &lt; &gt; b &gt; &lt; &#x5d0;...&#x202c;</div>
+<div dir="rtl">&#x202d;...a &gt; &lt; &#x5d1; &lt; &gt; c&#x202c;</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-001-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-001-ref.html
new file mode 100644
index 0000000000..b5882eb7a3
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-001-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from following number, opposite direction</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&#1488; 3&#8236;</div><div dir="ltr">&#8237;a 3&#8236;</div><div dir="rtl">&#8237;3 &#1488;&#8236;</div><div dir="rtl">&#8237;3 a&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&#1488; 3&#8236;</div><div dir="ltr">&#8237;a 3&#8236;</div><div dir="rtl">&#8237;3 &#1488;&#8236;</div><div dir="rtl">&#8237;3 a&#8236;</div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-002a-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-002a-ref.html
new file mode 100644
index 0000000000..f28559b5a1
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-002a-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from following number with intervening neutrals, opposite direction</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&lt; &#1488; &lt; &gt; 3 &gt;&#8236;</div><div dir="ltr">&#8237;&lt; a &lt; &gt; 3 &gt;&#8236;</div><div dir="rtl">&#8237;&lt; 3 &lt; &gt; &#1488; &gt;&#8236;</div><div dir="rtl">&#8237;&lt; 3 &lt; &gt; a &gt;&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&lt; &#1488; &lt; &gt; 3 &gt;&#8236;</div><div dir="ltr">&#8237;&lt; a &lt; &gt; 3 &gt;&#8236;</div><div dir="rtl">&#8237;&lt; 3 &lt; &gt; &#1488; &gt;&#8236;</div><div dir="rtl">&#8237;&lt; 3 &lt; &gt; a &gt;&#8236;</div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-002b-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-002b-ref.html
new file mode 100644
index 0000000000..d4eda2189d
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-002b-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from following number with intervening neutrals, auto</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&lt; &#1488; &lt; &gt; 3 &gt;&#8236;</div><div dir="ltr">&#8237;&gt; a &gt; &gt; 3 &gt;&#8236;</div><div dir="rtl">&#8237;&lt; 3 &lt; &lt; &#1488; &lt;&#8236;</div><div dir="rtl">&#8237;&lt; 3 &lt; &gt; a &gt;&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&lt; &#1488; &lt; &gt; 3 &gt;&#8236;</div><div dir="ltr">&#8237;&gt; a &gt; &gt; 3 &gt;&#8236;</div><div dir="rtl">&#8237;&lt; 3 &lt; &lt; &#1488; &lt;&#8236;</div><div dir="rtl">&#8237;&lt; 3 &lt; &gt; a &gt;&#8236;</div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-002c-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-002c-ref.html
new file mode 100644
index 0000000000..6c21d0147d
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-002c-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from following number with intervening neutrals, same direction</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&gt; &#1488; &gt; &gt; 3 &gt;&#8236;</div><div dir="ltr">&#8237;&gt; a &gt; &gt; 3 &gt;&#8236;</div><div dir="rtl">&#8237;&lt; 3 &lt; &lt; &#1488; &lt;&#8236;</div><div dir="rtl">&#8237;&lt; 3 &lt; &lt; a &lt;&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&gt; &#1488; &gt; &gt; 3 &gt;&#8236;</div><div dir="ltr">&#8237;&gt; a &gt; &gt; 3 &gt;&#8236;</div><div dir="rtl">&#8237;&lt; 3 &lt; &lt; &#1488; &lt;&#8236;</div><div dir="rtl">&#8237;&lt; 3 &lt; &lt; a &lt;&#8236;</div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-003-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-003-ref.html
new file mode 100644
index 0000000000..4c29838ee4
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-003-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from immediately following number, opposite direction</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&#1488;3&#8236;</div><div dir="ltr">&#8237;a3&#8236;</div><div dir="rtl">&#8237;3&#1488;&#8236;</div><div dir="rtl">&#8237;3a&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&#1488;3&#8236;</div><div dir="ltr">&#8237;a3&#8236;</div><div dir="rtl">&#8237;3&#1488;&#8236;</div><div dir="rtl">&#8237;3a&#8236;</div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-004-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-004-ref.html
new file mode 100644
index 0000000000..cb83dde584
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-004-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: numbers isolated from preceding text, opposite direction</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&#1488; 3&#8236;</div><div dir="ltr">&#8237;a 3&#8236;</div><div dir="rtl">&#8237;3 &#1488;&#8236;</div><div dir="rtl">&#8237;3 a&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&#1488; 3&#8236;</div><div dir="ltr">&#8237;a 3&#8236;</div><div dir="rtl">&#8237;3 &#1488;&#8236;</div><div dir="rtl">&#8237;3 a&#8236;</div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-005-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-005-ref.html
new file mode 100644
index 0000000000..4a6c301aa1
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-005-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from following text, opposite direction</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&#1488; &#1489;...&#8236;</div><div dir="ltr">&#8237;a b...&#8236;</div><div dir="rtl">&#8237;...b a&#8236;</div><div dir="rtl">&#8237;...&#1489; &#1488;&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&#1488; &#1489;...&#8236;</div><div dir="ltr">&#8237;a b...&#8236;</div><div dir="rtl">&#8237;...b a&#8236;</div><div dir="rtl">&#8237;...&#1489; &#1488;&#8236;</div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-006-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-006-ref.html
new file mode 100644
index 0000000000..0f6b7bbbd0
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-006-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from following text with intervening neutrals, opposite direction</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&lt; &#1488; &lt; &gt; &#1489; &gt;...&#8236;</div><div dir="rtl">&#8237;...&lt; b &lt; &gt; a &gt;&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&lt; &#1488; &lt; &gt; &#1489; &gt;...&#8236;</div><div dir="rtl">&#8237;...&lt; b &lt; &gt; a &gt;&#8236;</div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-006c-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-006c-ref.html
new file mode 100644
index 0000000000..0347c0910c
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-006c-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from following text with intervening neutrals, same direction</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&gt; &#1488; &gt; &gt; &#1489; &gt;...&#8236;</div><div dir="rtl">&#8237;...&lt; b &lt; &lt; a &lt;&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&gt; &#1488; &gt; &gt; &#1489; &gt;...&#8236;</div><div dir="rtl">&#8237;...&lt; b &lt; &lt; a &lt;&#8236;</div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-007-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-007-ref.html
new file mode 100644
index 0000000000..665153d649
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-007-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from immediately following text, opposite direction</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&#1488;&#1489;...&#8236;</div><div dir="ltr">&#8237;ab...&#8236;</div><div dir="rtl">&#8237;...ba&#8236;</div><div dir="rtl">&#8237;...&#1489;&#1488;&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&#1488;&#1489;...&#8236;</div><div dir="ltr">&#8237;ab...&#8236;</div><div dir="rtl">&#8237;...ba&#8236;</div><div dir="rtl">&#8237;...&#1489;&#1488;&#8236;</div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-008-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-008-ref.html
new file mode 100644
index 0000000000..8eb90f8b79
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-008-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from preceding text, opposite direction</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&#1488; &#1489;&#8236;</div><div dir="ltr">&#8237;a b&#8236;</div><div dir="rtl">&#8237;&#1489; &#1488;&#8236;</div><div dir="rtl">&#8237;b a&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&#1488; &#1489;&#8236;</div><div dir="ltr">&#8237;a b&#8236;</div><div dir="rtl">&#8237;&#1489; &#1488;&#8236;</div><div dir="rtl">&#8237;b a&#8236;</div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-009-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-009-ref.html
new file mode 100644
index 0000000000..1d2f57c6cf
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-009-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from surrounding text, opposite direction</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&#1490; &lt; &lt; b &lt; &lt; &#1488;...&#8236;</div><div dir="rtl">&#8237;...a &gt; &gt; &#1489; &gt; &gt; c&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&#1490; &lt; &lt; b &lt; &lt; &#1488;...&#8236;</div><div dir="rtl">&#8237;...a &gt; &gt; &#1489; &gt; &gt; c&#8236;</div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-009b-ref.html b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-009b-ref.html
new file mode 100644
index 0000000000..30ee14c6c0
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/reference/dir-isolation-009b-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<title>The dir attribute: isolated from surrounding text, auto</title>
+<style type="text/css">
+.test, .ref { font-size: 150%; border: 1px solid orange; margin: 10px; margin-right: 200px; padding: 5px; clear: both; }
+input { margin: 5px; }
+</style>
+</head>
+<body>
+<p class="instructions" dir="ltr">Test passes if the two boxes are identical.</p>
+<div class="ref"><div dir="ltr">&#8237;&#1490; &lt; &gt; b &gt; &lt; &#1488;...&#8236;</div><div dir="rtl">&#8237;...a &gt; &lt; &#1489; &lt; &gt; c&#8236;</div></div>
+<div class="ref"><div dir="ltr">&#8237;&#1490; &lt; &gt; b &gt; &lt; &#1488;...&#8236;</div><div dir="rtl">&#8237;...a &gt; &lt; &#1489; &lt; &gt; c&#8236;</div></div>
+</body>
+</html>