diff options
Diffstat (limited to 'testing/web-platform/tests/html/semantics/text-level-semantics')
62 files changed, 2151 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/historical.html b/testing/web-platform/tests/html/semantics/text-level-semantics/historical.html new file mode 100644 index 0000000000..7fe83a95ed --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/historical.html @@ -0,0 +1,29 @@ +<!doctype html> +<title>Historical text-level element features should not be supported</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id=log></div> +<script> +function t(property, tagNames) { + if (typeof tagNames === "string") { + tagNames = [tagNames]; + } + tagNames.forEach(function(tagName) { + test(function() { + assert_false(property in document.createElement(tagName)); + }, tagName + '.' + property + ' should not be supported'); + }); +} + +// <area> and <link> are in other sections in the spec, but we'll test them here together with <a> + +// removed in https://github.com/whatwg/html/commit/790479ab1ba143efc27d1f92cd0465627df48fb0 +t('hreflang', 'area'); +t('type', 'area'); + +// renamed to dateTime in https://github.com/whatwg/html/commit/8b6732237c7021cd61e3c3463146234ca8ce5bad +t('datetime', 'time'); + +// removed in https://github.com/whatwg/html/commit/66fcb2357f205448fe2f40d7834a1e8ea2ed283b +t('media', ['a', 'area']); +</script> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a-click-handler-with-null-browsing-context-crash.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a-click-handler-with-null-browsing-context-crash.html new file mode 100644 index 0000000000..a9fd6b82bd --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a-click-handler-with-null-browsing-context-crash.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<title>HTMLAnchorElement.onclick with null browsing conext</title> +<link rel="author" title="Nate Chapin" href="mailto:japhet@chromium.org"> +<link rel="help" href="https://html.spec.whatwg.org/C/#the-a-element"> +<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1083721"> +<meta name="assert" content="An <a> from a discarded browsing context that is cloned into a new document should not crash when clicked"/> +<body> +<iframe id="i" src="resources/a-onclick-handler-iframe.html"></iframe> +<script> +window.onload = () => { + var range = i.contentDocument.createRange(); + range.selectNodeContents(i.contentDocument.body); + i.remove(); + + // Clone the <a> into this document, and ensure clicking it does not crash. + document.body.appendChild(range.cloneContents()); + var a = document.getElementsByTagName('a')[0]; + a.click(); +}; +</script> +</body> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a-download-404.py b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a-download-404.py new file mode 100644 index 0000000000..abb85139b3 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a-download-404.py @@ -0,0 +1,2 @@ +def main(request, response): + return 404, [(b"Content-Type", b"text/html")], b'Some content for the masses.' * 100 diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a-download-click-404.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a-download-click-404.html new file mode 100644 index 0000000000..3c8adc0b97 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a-download-click-404.html @@ -0,0 +1,25 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Clicking on an <a> element with a download attribute and href that leads to 404 should not navigate</title> +<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-a-element:activation-behaviour"> +<link rel="help" href="https://html.spec.whatwg.org/multipage/links.html#attr-hyperlink-download"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<body> +<script> +"use strict"; +async_test(t => { + const errorFrame = document.createElement("iframe"); + + errorFrame.addEventListener("load", t.step_func(function () { + errorFrame.contentWindow.addEventListener( + "beforeunload", t.unreached_func("Navigated instead of downloading")); + + errorFrame.contentDocument.querySelector("#error-url").click(); + t.step_timeout(() => t.done(), 1000); + })); + errorFrame.src = "resources/a-download-404.html"; + document.body.appendChild(errorFrame); +}, "Do not navigate to 404 for anchor with download"); +</script> +</body> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a-download-click-redirect-to-javascript.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a-download-click-redirect-to-javascript.html new file mode 100644 index 0000000000..09f63b6f4d --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a-download-click-redirect-to-javascript.html @@ -0,0 +1,29 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Clicking on an <a> element with a download attribute and href that redirects to 'javascript:' should not navigate or execute</title> +<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-a-element:activation-behaviour"> +<link rel="help" href="https://html.spec.whatwg.org/multipage/links.html#attr-hyperlink-download"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<body> +<script> +"use strict"; +async_test(t => { + const errorFrame = document.createElement("iframe"); + + errorFrame.addEventListener("load", t.step_func(function () { + assert_false(errorFrame.contentWindow.executed); + errorFrame.contentWindow.addEventListener( + "beforeunload", t.unreached_func("Page should not navigate.")); + + errorFrame.contentDocument.querySelector("#error-url").click(); + t.step_timeout(_ => { + assert_false(errorFrame.contentWindow.executed, "Redirecting to javascript: was suppressed."); + t.done(); + }, 1000); + })); + errorFrame.src = "resources/a-download-redirect-to-javascript.html"; + document.body.appendChild(errorFrame); +}, "Do not navigate or execute JS when redirecting a download to 'javascript:..'"); +</script> +</body> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a-download-click.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a-download-click.html new file mode 100644 index 0000000000..22d329f245 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a-download-click.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Clicking on an <a> element with a download attribute must not throw an exception</title> +<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me"> +<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-a-element:activation-behaviour"> +<link rel="help" href="https://github.com/whatwg/html/issues/2116"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<body> +<script> +"use strict"; +async_test(t => { + const frame = document.createElement("iframe"); + + frame.addEventListener("load", t.step_func(function () { + frame.contentWindow.addEventListener( + "beforeunload", t.unreached_func("Navigated instead of downloading")); + const string = "test"; + const blob = new Blob([string], { type: "text/html" }); + + const link = frame.contentDocument.querySelector("#blob-url"); + link.href = URL.createObjectURL(blob); + + link.click(); + + t.step_timeout(() => t.done(), 1000); + })); + frame.src = "resources/a-download-click.html"; + document.body.appendChild(frame); +}, "Clicking on an <a> element with a download attribute must not throw an exception"); +</script> +</body> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a-stringifier.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a-stringifier.html new file mode 100644 index 0000000000..1085a74aa6 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a-stringifier.html @@ -0,0 +1,16 @@ +<!DOCTYPE html> +<title>HTMLAnchorElement stringifier</title> +<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"> +<link rel="help" href="https://webidl.spec.whatwg.org/#es-stringifier"> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<script src=/common/stringifiers.js></script> +<div id=log></div> +<script> +test(function() { + test_stringifier_attribute(document.createElement("a"), "href", false); + var a = document.createElement("a"); + a.setAttribute("href", "foo"); + test_stringifier_attribute(a, "href", false); +}); +</script> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a.text-getter-01.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a.text-getter-01.html new file mode 100644 index 0000000000..e0bb73be0f --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a.text-getter-01.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<title>HTMLAnchorElement.text getting</title> +<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"> +<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-a-text"> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<div id=log></div> +<script>var b</script> +<div id="test"> +<a href="a">a b c </a> +<a href="b">a <!--b-->b c </a> +<a href="c">a <b>b</b> c </a> +<a href="d">a <script>b</script> c </a> +<script> +var e = document.getElementById("test") + .appendChild(document.createElement("a")); +e.href = "d"; +e.appendChild(document.createTextNode("a ")); +e.appendChild(document.createTextNode("b ")); +e.appendChild(document.createTextNode("c ")); +</script> +</div> +<script> +test(function() { + var list = document.getElementById("test") + .getElementsByTagName("a"); + for (var i = 0, il = list.length; i < il; ++i) { + test(function() { + assert_equals(list[i].text, list[i].textContent); + assert_equals(list[i].text, "a b c "); + }, "Test for anchor " + i); + } +}); +</script> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a.text-setter-01.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a.text-setter-01.html new file mode 100644 index 0000000000..879a9e3d08 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/a.text-setter-01.html @@ -0,0 +1,41 @@ +<!DOCTYPE html> +<title>HTMLAnchorElement.text setting</title> +<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"> +<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-a-text"> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<div id=log></div> +<div id="test"> +<a href="a">a b c</a> +<a href="b">a <!--b--> c</a> +<a href="c">a <b>b</b> c</a> +<script> +var d = document.getElementById("test") + .appendChild(document.createElement("a")); +d.href = "d"; +d.appendChild(document.createTextNode("a ")); +d.appendChild(document.createTextNode("b ")); +d.appendChild(document.createTextNode("c ")); +</script> +</div> +<script> +test(function() { + var list = document.getElementById("test") + .getElementsByTagName("a"); + for (var i = 0, il = list.length; i < il; ++i) { + test(function() { + list[i].text = "x"; + assert_equals(list[i].text, "x"); + assert_equals(list[i].textContent, "x"); + assert_equals(list[i].firstChild.data, "x"); + assert_equals(list[i].childNodes.length, 1); + + list[i].textContent = "y"; + assert_equals(list[i].text, "y"); + assert_equals(list[i].textContent, "y"); + assert_equals(list[i].firstChild.data, "y"); + assert_equals(list[i].childNodes.length, 1); + }, "Test for anchor " + i); + } +}); +</script> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/resources/a-download-404.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/resources/a-download-404.html new file mode 100644 index 0000000000..8c5d8f4565 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/resources/a-download-404.html @@ -0,0 +1,2 @@ +<!doctype html> +<a id="error-url" href="../a-download-404.py" download="html.html">Click me</a> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/resources/a-download-click.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/resources/a-download-click.html new file mode 100644 index 0000000000..7d36c21d1e --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/resources/a-download-click.html @@ -0,0 +1,2 @@ +<!doctype html> +<a id="blob-url" download="foo.html">Click me</a> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/resources/a-download-redirect-to-javascript.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/resources/a-download-redirect-to-javascript.html new file mode 100644 index 0000000000..4ff8b61e3b --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/resources/a-download-redirect-to-javascript.html @@ -0,0 +1,5 @@ +<!doctype html> +<script> + window.executed = false; +</script> +<a id="error-url" href="/common/redirect.py?location=javascript:window.executed=true" download="html.html">Click me</a> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/resources/a-onclick-handler-iframe.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/resources/a-onclick-handler-iframe.html new file mode 100644 index 0000000000..711e40f9d4 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-a-element/resources/a-onclick-handler-iframe.html @@ -0,0 +1 @@ +<a id="a" href="about:blank" onclick="return false">link</a> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-b-element/b-usage-notref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-b-element/b-usage-notref.html new file mode 100644 index 0000000000..3d3c46a281 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-b-element/b-usage-notref.html @@ -0,0 +1,6 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>HTML Reference File</title> +<link rel="author" title="Intel" href="http://www.intel.com/"> + +<p>You enter a small room. Your sword glows brighter. A rat scurries past the corner wall.</p> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-b-element/b-usage.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-b-element/b-usage.html new file mode 100644 index 0000000000..ff2105dcae --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-b-element/b-usage.html @@ -0,0 +1,8 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>HTML test: b - highlight keywords</title> +<link rel="author" title="Intel" href="http://www.intel.com/"> +<link rel="mismatch" href="b-usage-notref.html"> +<link rel="help" href="https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-b-element"/> + +<p>You enter a small room. Your <b>sword</b> glows brighter. A <b>rat</b> scurries past the corner wall.</p> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-auto-dir-default-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-auto-dir-default-ref.html new file mode 100644 index 0000000000..eff61bb419 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-auto-dir-default-ref.html @@ -0,0 +1,36 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 500px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + </div> + <div class="test"> + <div dir="ltr">‭[:)], [+- a ב], [d ג 1]...‬</div> + <div dir="rtl">‭...[d ג 1] ,[+- a ב] ,[:)]‬</div> + </div> + <div class="ref"> + <div dir="ltr">‭[:)], [+- a ב], [d ג 1]...‬</div> + <div dir="rtl">‭...[d ג 1] ,[+- a ב] ,[:)]‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-auto-dir-default.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-auto-dir-default.html new file mode 100644 index 0000000000..e658500a4e --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-auto-dir-default.html @@ -0,0 +1,46 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"/> + <title>HTML Test: BDI: has dir=auto by default</title> + <link rel="match" href="bdi-auto-dir-default-ref.html"/> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/> + <meta name="assert" content=" + 'The dir global attribute defaults to auto on this element (it never inherits from the parent + element like with other elements).'"/> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 500px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + In each DIV of the test: + - the first BDI, having no characters with strong direction, should be LTR by default; + - the second BDI, having an LTR character first, should be LTR by default; + - the third BDI, having an RTL character first, should be RTL by default. + </div> + <div class="test"> + <div dir="ltr"><bdi>[:)]</bdi>, <bdi>[+- a ב]</bdi>, <bdi>[1 ג d]</bdi>...</div> + <div dir="rtl"><bdi>[:)]</bdi>, <bdi>[+- a ב]</bdi>, <bdi>[1 ג d]</bdi>...</div> + </div> + <div class="ref"> + <div dir="ltr">‭[:)], [+- a ב], [d ג 1]...‬</div> + <div dir="rtl">‭...[d ג 1] ,[+- a ב] ,[:)]‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-missing-pdf-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-missing-pdf-ref.html new file mode 100644 index 0000000000..b4d44c5101 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-missing-pdf-ref.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + </div> + <div class="test"> + <div dir="ltr">‭cbאde...‬</div> + <div dir="ltr">‭cbאde...‬</div> + <div dir="ltr">‭cbאde...‬</div> + <div dir="rtl">‭...הדaבג‬</div> + <div dir="rtl">‭...הדaבג‬</div> + <div dir="rtl">‭...הדaבג‬</div> + </div> + <div class="ref"> + <div dir="ltr">‭cbאde...‬</div> + <div dir="ltr">‭cbאde...‬</div> + <div dir="ltr">‭cbאde...‬</div> + <div dir="rtl">‭...הדaבג‬</div> + <div dir="rtl">‭...הדaבג‬</div> + <div dir="rtl">‭...הדaבג‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-missing-pdf.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-missing-pdf.html new file mode 100644 index 0000000000..1ce9da6b76 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-missing-pdf.html @@ -0,0 +1,56 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"/> + <title>HTML Test: BDI: neutral when contains LRO or RLO without PDF</title> + <link rel="match" href="bdi-neutral-missing-pdf-ref.html"/> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/> + <meta name="assert" content=" + 'For the purposes of applying the bidirectional algorithm to the paragraph-level + container that a bdi element finds itself within, the bdi element must be treated + like a U+FFFC OBJECT REPLACEMENT CHARACTER.' + Thus, if a BDI contains LRO or RLO characters lacking a matching PDF, these must not affect + the visual ordering of the content outside the BDI."/> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‮ - the RLO (right-to-left-override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO and RLO. + If the BDI in the test's first DIV were a SPAN, the RLO it contains, not being closed by a + PDF, would visually reorder the de into ed. + </div> + <div class="test"> + <div dir="ltr"><bdi>א‮bc</bdi>de...</div> + <div dir="ltr"><bdi dir="ltr">א‮bc</bdi>de...</div> + <div dir="ltr"><bdi dir="rtl">א‮bc</bdi>de...</div> + <div dir="rtl"><bdi>a‭בג</bdi>דה...</div> + <div dir="rtl"><bdi dir="ltr">a‭בג</bdi>דה...</div> + <div dir="rtl"><bdi dir="rtl">a‭בג</bdi>דה...</div> + </div> + <div class="ref"> + <div dir="ltr">‭cbאde...‬</div> + <div dir="ltr">‭cbאde...‬</div> + <div dir="ltr">‭cbאde...‬</div> + <div dir="rtl">‭...הדaבג‬</div> + <div dir="rtl">‭...הדaבג‬</div> + <div dir="rtl">‭...הדaבג‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-nested-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-nested-ref.html new file mode 100644 index 0000000000..d5d7674a45 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-nested-ref.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 500px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + </div> + <div class="test"> + <div dir="ltr">‭1 + [a + [3 + [b + 4] + ב] + 2] + א‬</div> + <div dir="ltr">‭1 + [a + [3 + [b + 4] + ב] + 2] + א‬</div> + <div dir="ltr">‭1 + [a + [3 + [b + 4] + ב] + 2] + א‬</div> + <div dir="rtl">‭a + [1 + [b + [3 + ב] + 2] + א] + 0‬</div> + <div dir="rtl">‭a + [1 + [b + [3 + ב] + 2] + א] + 0‬</div> + <div dir="rtl">‭a + [1 + [b + [3 + ב] + 2] + א] + 0‬</div> + </div> + <div class="ref"> + <div dir="ltr">‭1 + [a + [3 + [b + 4] + ב] + 2] + א‬</div> + <div dir="ltr">‭1 + [a + [3 + [b + 4] + ב] + 2] + א‬</div> + <div dir="ltr">‭1 + [a + [3 + [b + 4] + ב] + 2] + א‬</div> + <div dir="rtl">‭a + [1 + [b + [3 + ב] + 2] + א] + 0‬</div> + <div dir="rtl">‭a + [1 + [b + [3 + ב] + 2] + א] + 0‬</div> + <div dir="rtl">‭a + [1 + [b + [3 + ב] + 2] + א] + 0‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-nested.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-nested.html new file mode 100644 index 0000000000..158576885c --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-nested.html @@ -0,0 +1,52 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"/> + <title>HTML Test: BDI: neutral when nested</title> + <link rel="match" href="bdi-neutral-nested-ref.html"/> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/> + <meta name="assert" content=" + 'For the purposes of applying the bidirectional algorithm to the paragraph-level + container that a bdi element finds itself within, the bdi element must be treated + like a U+FFFC OBJECT REPLACEMENT CHARACTER.' + This must apply when a BDI is nested within a BDI."/> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 500px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + </div> + <div class="test"> + <div dir="ltr">א + <bdi>[a + <bdi>[ב + <bdi>[b + 4]</bdi> + 3]</bdi> + 2]</bdi> + 1</div> + <div dir="ltr">א + <bdi dir="rtl">[a + <bdi dir="ltr">[ב + <bdi dir="rtl">[b + 4]</bdi> + 3]</bdi> + 2]</bdi> + 1</div> + <div dir="ltr">א + <bdi dir="ltr">[a + <bdi dir="rtl">[ב + <bdi dir="ltr">[b + 4]</bdi> + 3]</bdi> + 2]</bdi> + 1</div> + <div dir="rtl">a + <bdi>[א + <bdi>[b + <bdi>[ב + 3]</bdi> + 2]</bdi> + 1]</bdi> + 0</div> + <div dir="rtl">a + <bdi dir="ltr">[א + <bdi dir="rtl">[b + <bdi dir="ltr">[ב + 3]</bdi> + 2]</bdi> + 1]</bdi> + 0</div> + <div dir="rtl">a + <bdi dir="rtl">[א + <bdi dir="ltr">[b + <bdi dir="rtl">[ב + 3]</bdi> + 2]</bdi> + 1]</bdi> + 0</div> + </div> + <div class="ref"> + <div dir="ltr">‭1 + [a + [3 + [b + 4] + ב] + 2] + א‬</div> + <div dir="ltr">‭1 + [a + [3 + [b + 4] + ב] + 2] + א‬</div> + <div dir="ltr">‭1 + [a + [3 + [b + 4] + ב] + 2] + א‬</div> + <div dir="rtl">‭a + [1 + [b + [3 + ב] + 2] + א] + 0‬</div> + <div dir="rtl">‭a + [1 + [b + [3 + ב] + 2] + א] + 0‬</div> + <div dir="rtl">‭a + [1 + [b + [3 + ב] + 2] + א] + 0‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-number-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-number-ref.html new file mode 100644 index 0000000000..df7af7778a --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-number-ref.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + </div> + <div class="test"> + <div dir="ltr">‭א - [1]...‬</div> + <div dir="ltr">‭א - [1]...‬</div> + <div dir="ltr">‭א - [1]...‬</div> + <div dir="rtl">‭...[1] - a‬</div> + <div dir="rtl">‭...[1] - a‬</div> + <div dir="rtl">‭...[1] - a‬</div> + </div> + <div class="ref"> + <div dir="ltr">‭א - [1]...‬</div> + <div dir="ltr">‭א - [1]...‬</div> + <div dir="ltr">‭א - [1]...‬</div> + <div dir="rtl">‭...[1] - a‬</div> + <div dir="rtl">‭...[1] - a‬</div> + <div dir="rtl">‭...[1] - a‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-number.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-number.html new file mode 100644 index 0000000000..37e467c173 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-number.html @@ -0,0 +1,53 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"/> + <title>HTML Test: BDI: neutral when number</title> + <link rel="match" href="bdi-neutral-number-ref.html"/> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/> + <meta name="assert" content=" + 'For the purposes of applying the bidirectional algorithm to the paragraph-level + container that a bdi element finds itself within, the bdi element must be treated + like a U+FFFC OBJECT REPLACEMENT CHARACTER.'"/> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + If the BDI in the test's first DIV were a SPAN, the 1 inside it would be visually ordered + to the left of the א. + </div> + <div class="test"> + <div dir="ltr">א - <bdi>[1]</bdi>...</div> + <div dir="ltr">א - <bdi dir="ltr">[1]</bdi>...</div> + <div dir="ltr">א - <bdi dir="rtl">[1]</bdi>...</div> + <div dir="rtl">a - <bdi>[1]</bdi>...</div> + <div dir="rtl">a - <bdi dir="ltr">[1]</bdi>...</div> + <div dir="rtl">a - <bdi dir="rtl">[1]</bdi>...</div> + </div> + <div class="ref"> + <div dir="ltr">‭א - [1]...‬</div> + <div dir="ltr">‭א - [1]...‬</div> + <div dir="ltr">‭א - [1]...‬</div> + <div dir="rtl">‭...[1] - a‬</div> + <div dir="rtl">‭...[1] - a‬</div> + <div dir="rtl">‭...[1] - a‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-separate-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-separate-ref.html new file mode 100644 index 0000000000..ec8e34627d --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-separate-ref.html @@ -0,0 +1,36 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 500px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + </div> + <div class="test"> + <div dir="ltr">‭א [1 b] c [d ה] ו...‬</div> + <div dir="rtl">‭...f [e ד] ג [ב 1] a‬</div> + </div> + <div class="ref"> + <div dir="ltr">‭א [1 b] c [d ה] ו...‬</div> + <div dir="rtl">‭...f [e ד] ג [ב 1] a‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-separate.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-separate.html new file mode 100644 index 0000000000..7bb8a20811 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-separate.html @@ -0,0 +1,47 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"/> + <title>HTML Test: BDI: paragraph-level container</title> + <link rel="match" href="bdi-neutral-separate-ref.html"/> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/> + <meta name="assert" content=" + 'For the purposes of applying the bidirectional algorithm to the paragraph-level + container that a bdi element finds itself within, the bdi element must be treated + like a U+FFFC OBJECT REPLACEMENT CHARACTER.' + Thus, under no circumstances should any part of the content outside a BDI be visually + reordered inside the BDI's content."/> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 500px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + If the BDIs in the test's first DIV were just SPANs, the א would appear between the 1 + and the b, and the ו between the d and the ה. + </div> + <div class="test"> + <div dir="ltr">א <bdi>[1 b]</bdi> c <bdi>[d ה]</bdi> ו...</div> + <div dir="rtl">a <bdi>[1 ב]</bdi> ג <bdi>[ד e]</bdi> f...</div> + </div> + <div class="ref"> + <div dir="ltr">‭א [1 b] c [d ה] ו...‬</div> + <div dir="rtl">‭...f [e ד] ג [ב 1] a‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-1-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-1-ref.html new file mode 100644 index 0000000000..c0f323ea2c --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-1-ref.html @@ -0,0 +1,47 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8" /> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" /> + <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" /> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" /> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { + display: none; + } + </style> + </head> + <body> + <div class="instructions">Test passes if the two boxes below look exactly the same.</div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + </div> + <div class="test"> + <div dir="ltr">‭[א] > [ב]...‬</div> + <div dir="ltr">‭[א] > [ב]...‬</div> + <div dir="ltr">‭[א] > [ב]...‬</div> + <div dir="rtl">‭...[b] < [a]‬</div> + <div dir="rtl">‭...[b] < [a]‬</div> + <div dir="rtl">‭...[b] < [a]‬</div> + </div> + <div class="ref"> + <div dir="ltr">‭[א] > [ב]...‬</div> + <div dir="ltr">‭[א] > [ב]...‬</div> + <div dir="ltr">‭[א] > [ב]...‬</div> + <div dir="rtl">‭...[b] < [a]‬</div> + <div dir="rtl">‭...[b] < [a]‬</div> + <div dir="rtl">‭...[b] < [a]‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-1.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-1.html new file mode 100644 index 0000000000..822120721f --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-1.html @@ -0,0 +1,58 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8" /> + <title>HTML Test: BDI: neutral to another BDI</title> + <link rel="match" href="bdi-neutral-to-another-bdi-1-ref.html" /> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" /> + <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" /> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" /> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element" /> + <meta name="assert" content=" + 'For the purposes of applying the bidirectional algorithm to the paragraph-level + container that a bdi element finds itself within, the bdi element must be treated + like a U+FFFC OBJECT REPLACEMENT CHARACTER.' + Thus, when a BDI contains text of the same strong direction as another BDI following it, the + two must not form a directional run as would be the case if the BDIs were just SPANs." /> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { + display: none; + } + </style> + </head> + <body> + <div class="instructions">Test passes if the two boxes below look exactly the same.</div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + If the BDIs in the test's first DIV were SPANs, the ב would be rendered to the left + of the א. + </div> + <div class="test"> + <div dir="ltr"><bdi>[א]</bdi> > <bdi>[ב]</bdi>...</div> + <div dir="ltr"><bdi dir="rtl">[א]</bdi> > <bdi dir="rtl">[ב]</bdi>...</div> + <div dir="ltr"><bdi dir="ltr">[א]</bdi> > <bdi dir="ltr">[ב]</bdi>...</div> + <div dir="rtl"><bdi>[a]</bdi> > <bdi>[b]</bdi>...</div> + <div dir="rtl"><bdi dir="ltr">[a]</bdi> > <bdi dir="ltr">[b]</bdi>...</div> + <div dir="rtl"><bdi dir="rtl">[a]</bdi> > <bdi dir="rtl">[b]</bdi>...</div> + </div> + <div class="ref"> + <div dir="ltr">‭[א] > [ב]...‬</div> + <div dir="ltr">‭[א] > [ב]...‬</div> + <div dir="ltr">‭[א] > [ב]...‬</div> + <div dir="rtl">‭...[b] < [a]‬</div> + <div dir="rtl">‭...[b] < [a]‬</div> + <div dir="rtl">‭...[b] < [a]‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-2-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-2-ref.html new file mode 100644 index 0000000000..9aef97c0ea --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-2-ref.html @@ -0,0 +1,47 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8" /> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" /> + <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" /> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" /> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { + display: none; + } + </style> + </head> + <body> + <div class="instructions">Test passes if the two boxes below look exactly the same.</div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + </div> + <div class="test"> + <div dir="ltr">‭אב...‬</div> + <div dir="ltr">‭אב...‬</div> + <div dir="ltr">‭אב...‬</div> + <div dir="rtl">‭...ba‬</div> + <div dir="rtl">‭...ba‬</div> + <div dir="rtl">‭...ba‬</div> + </div> + <div class="ref"> + <div dir="ltr">‭אב...‬</div> + <div dir="ltr">‭אב...‬</div> + <div dir="ltr">‭אב...‬</div> + <div dir="rtl">‭...ba‬</div> + <div dir="rtl">‭...ba‬</div> + <div dir="rtl">‭...ba‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-2.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-2.html new file mode 100644 index 0000000000..85aec46686 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-another-bdi-2.html @@ -0,0 +1,59 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8" /> + <title>HTML Test: BDI: neutral to another immediately following BDI</title> + <link rel="match" href="bdi-neutral-to-another-bdi-2-ref.html"> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com" /> + <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com" /> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" /> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element" /> + <meta name="assert" content=" + 'For the purposes of applying the bidirectional algorithm to the paragraph-level + container that a bdi element finds itself within, the bdi element must be treated + like a U+FFFC OBJECT REPLACEMENT CHARACTER.' + Thus, when a BDI contains text of the same strong direction as another BDI following it, the + two must not form a directional run as would be the case if the BDIs were just SPANs, even if + the two BDIs are not separated by anything at all." /> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { + display: none; + } + </style> + </head> + <body> + <div class="instructions">Test passes if the two boxes below look exactly the same.</div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + If the BDIs in the test's first DIV were SPANs, the ב would be rendered to the left of + the א. + </div> + <div class="test"> + <div dir="ltr"><bdi>א</bdi><bdi>ב</bdi>...</div> + <div dir="ltr"><bdi dir="rtl">א</bdi><bdi dir="rtl">ב</bdi>...</div> + <div dir="ltr"><bdi dir="ltr">א</bdi><bdi dir="ltr">ב</bdi>...</div> + <div dir="rtl"><bdi>a</bdi><bdi>b</bdi>...</div> + <div dir="rtl"><bdi dir="ltr">a</bdi><bdi dir="ltr">b</bdi>...</div> + <div dir="rtl"><bdi dir="rtl">a</bdi><bdi dir="rtl">b</bdi>...</div> + </div> + <div class="ref"> + <div dir="ltr">‭אב...‬</div> + <div dir="ltr">‭אב...‬</div> + <div dir="ltr">‭אב...‬</div> + <div dir="rtl">‭...ba‬</div> + <div dir="rtl">‭...ba‬</div> + <div dir="rtl">‭...ba‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-1-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-1-ref.html new file mode 100644 index 0000000000..a34d09bd24 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-1-ref.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"> + <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com"> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + </div> + <div class="test"> + <div dir="ltr">‭[א] > ב...‬</div> + <div dir="ltr">‭[א] > ב...‬</div> + <div dir="ltr">‭[א] > ב...‬</div> + <div dir="rtl">‭...b < [a]‬</div> + <div dir="rtl">‭...b < [a]‬</div> + <div dir="rtl">‭...b < [a]‬</div> + </div> + <div class="ref"> + <div dir="ltr">‭[א] > ב...‬</div> + <div dir="ltr">‭[א] > ב...‬</div> + <div dir="ltr">‭[א] > ב...‬</div> + <div dir="rtl">‭...b < [a]‬</div> + <div dir="rtl">‭...b < [a]‬</div> + <div dir="rtl">‭...b < [a]‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-1.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-1.html new file mode 100644 index 0000000000..76da57c2b9 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-1.html @@ -0,0 +1,54 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"/> + <title>HTML Test: BDI: neutral to following letter</title> + <link rel="match" href="bdi-neutral-to-letter-following-1-ref.html"/> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/> + <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com"/> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/> + <meta name="assert" content=" + 'For the purposes of applying the bidirectional algorithm to the paragraph-level + container that a bdi element finds itself within, the bdi element must be treated + like a U+FFFC OBJECT REPLACEMENT CHARACTER.'"/> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + If the BDI in the test's first DIV were a SPAN, the ב would be rendered to the left + of the א + </div> + <div class="test"> + <div dir="ltr"><bdi>[א]</bdi> > ב...</div> + <div dir="ltr"><bdi dir="rtl">[א]</bdi> > ב...</div> + <div dir="ltr"><bdi dir="ltr">[א]</bdi> > ב...</div> + <div dir="rtl"><bdi>[a]</bdi> > b...</div> + <div dir="rtl"><bdi dir="ltr">[a]</bdi> > b...</div> + <div dir="rtl"><bdi dir="rtl">[a]</bdi> > b...</div> + </div> + <div class="ref"> + <div dir="ltr">‭[א] > ב...‬</div> + <div dir="ltr">‭[א] > ב...‬</div> + <div dir="ltr">‭[א] > ב...‬</div> + <div dir="rtl">‭...b < [a]‬</div> + <div dir="rtl">‭...b < [a]‬</div> + <div dir="rtl">‭...b < [a]‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-2-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-2-ref.html new file mode 100644 index 0000000000..80f36183b0 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-2-ref.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"> + <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com"> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + </div> + <div class="test"> + <div dir="ltr">‭אב...‬</div> + <div dir="ltr">‭אב...‬</div> + <div dir="ltr">‭אב...‬</div> + <div dir="rtl">‭...ba‬</div> + <div dir="rtl">‭...ba‬</div> + <div dir="rtl">‭...ba‬</div> + </div> + <div class="ref"> + <div dir="ltr">‭אב...‬</div> + <div dir="ltr">‭אב...‬</div> + <div dir="ltr">‭אב...‬</div> + <div dir="rtl">‭...ba‬</div> + <div dir="rtl">‭...ba‬</div> + <div dir="rtl">‭...ba‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-2.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-2.html new file mode 100644 index 0000000000..ce41983f00 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-following-2.html @@ -0,0 +1,54 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"/> + <title>HTML Test: BDI: neutral to immediately following letter</title> + <link rel="match" href="bdi-neutral-to-letter-following-2-ref.html"> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/> + <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com"/> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/> + <meta name="assert" content=" + 'For the purposes of applying the bidirectional algorithm to the paragraph-level + container that a bdi element finds itself within, the bdi element must be treated + like a U+FFFC OBJECT REPLACEMENT CHARACTER.'"/> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + If the BDI in the following DIV were a SPAN, the ב would be rendered to the left + of the א + </div> + <div class="test"> + <div dir="ltr"><bdi>א</bdi>ב...</div> + <div dir="ltr"><bdi dir="rtl">א</bdi>ב...</div> + <div dir="ltr"><bdi dir="ltr">א</bdi>ב...</div> + <div dir="rtl"><bdi>a</bdi>b...</div> + <div dir="rtl"><bdi dir="ltr">a</bdi>b...</div> + <div dir="rtl"><bdi dir="rtl">a</bdi>b...</div> + </div> + <div class="ref"> + <div dir="ltr">‭אב...‬</div> + <div dir="ltr">‭אב...‬</div> + <div dir="ltr">‭אב...‬</div> + <div dir="rtl">‭...ba‬</div> + <div dir="rtl">‭...ba‬</div> + <div dir="rtl">‭...ba‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-1-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-1-ref.html new file mode 100644 index 0000000000..5e39eabd28 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-1-ref.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"> + <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com"> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + </div> + <div class="test"> + <div dir="ltr">‭א > [ב]...‬</div> + <div dir="ltr">‭א > [ב]...‬</div> + <div dir="ltr">‭א > [ב]...‬</div> + <div dir="rtl">‭...[b] < a‬</div> + <div dir="rtl">‭...[b] < a‬</div> + <div dir="rtl">‭...[b] < a‬</div> + </div> + <div class="ref"> + <div dir="ltr">‭א > [ב]...‬</div> + <div dir="ltr">‭א > [ב]...‬</div> + <div dir="ltr">‭א > [ב]...‬</div> + <div dir="rtl">‭...[b] < a‬</div> + <div dir="rtl">‭...[b] < a‬</div> + <div dir="rtl">‭...[b] < a‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-1.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-1.html new file mode 100644 index 0000000000..46772de642 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-1.html @@ -0,0 +1,54 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"/> + <title>HTML Test: BDI: neutral to preceding letter</title> + <link rel="match" href="bdi-neutral-to-letter-preceding-1-ref.html"> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/> + <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com"/> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/> + <meta name="assert" content=" + 'For the purposes of applying the bidirectional algorithm to the paragraph-level + container that a bdi element finds itself within, the bdi element must be treated + like a U+FFFC OBJECT REPLACEMENT CHARACTER.'"/> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + If the BDI in the test's first DIV were a SPAN, the ב would be rendered to the left + of the א + </div> + <div class="test"> + <div dir="ltr">א > <bdi>[ב]</bdi>...</div> + <div dir="ltr">א > <bdi dir="rtl">[ב]</bdi>...</div> + <div dir="ltr">א > <bdi dir="ltr">[ב]</bdi>...</div> + <div dir="rtl">a > <bdi>[b]</bdi>...</div> + <div dir="rtl">a > <bdi dir="ltr">[b]</bdi>...</div> + <div dir="rtl">a > <bdi dir="rtl">[b]</bdi>...</div> + </div> + <div class="ref"> + <div dir="ltr">‭א > [ב]...‬</div> + <div dir="ltr">‭א > [ב]...‬</div> + <div dir="ltr">‭א > [ב]...‬</div> + <div dir="rtl">‭...[b] < a‬</div> + <div dir="rtl">‭...[b] < a‬</div> + <div dir="rtl">‭...[b] < a‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-2-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-2-ref.html new file mode 100644 index 0000000000..80f36183b0 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-2-ref.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"> + <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com"> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + </div> + <div class="test"> + <div dir="ltr">‭אב...‬</div> + <div dir="ltr">‭אב...‬</div> + <div dir="ltr">‭אב...‬</div> + <div dir="rtl">‭...ba‬</div> + <div dir="rtl">‭...ba‬</div> + <div dir="rtl">‭...ba‬</div> + </div> + <div class="ref"> + <div dir="ltr">‭אב...‬</div> + <div dir="ltr">‭אב...‬</div> + <div dir="ltr">‭אב...‬</div> + <div dir="rtl">‭...ba‬</div> + <div dir="rtl">‭...ba‬</div> + <div dir="rtl">‭...ba‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-2.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-2.html new file mode 100644 index 0000000000..192115775c --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-letter-preceding-2.html @@ -0,0 +1,54 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"/> + <title>HTML Test: BDI: neutral to immediately preceding letter</title> + <link rel="match" href="bdi-neutral-to-letter-preceding-2-ref.html"/> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/> + <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com"/> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/> + <meta name="assert" content=" + 'For the purposes of applying the bidirectional algorithm to the paragraph-level + container that a bdi element finds itself within, the bdi element must be treated + like a U+FFFC OBJECT REPLACEMENT CHARACTER.'"/> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + If the BDI in the test's first DIV were a SPAN, the ב would be rendered to the left + of the א + </div> + <div class="test"> + <div dir="ltr">א<bdi>ב</bdi>...</div> + <div dir="ltr">א<bdi dir="rtl">ב</bdi>...</div> + <div dir="ltr">א<bdi dir="ltr">ב</bdi>...</div> + <div dir="rtl">a<bdi>b</bdi>...</div> + <div dir="rtl">a<bdi dir="ltr">b</bdi>...</div> + <div dir="rtl">a<bdi dir="rtl">b</bdi>...</div> + </div> + <div class="ref"> + <div dir="ltr">‭אב...‬</div> + <div dir="ltr">‭אב...‬</div> + <div dir="ltr">‭אב...‬</div> + <div dir="rtl">‭...ba‬</div> + <div dir="rtl">‭...ba‬</div> + <div dir="rtl">‭...ba‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-1-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-1-ref.html new file mode 100644 index 0000000000..ad15d468b8 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-1-ref.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"> + <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com"> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + </div> + <div class="test"> + <div dir="ltr">‭[א] (3 reviews)...‬</div> + <div dir="ltr">‭[א] (3 reviews)...‬</div> + <div dir="ltr">‭[א] (3 reviews)...‬</div> + <div dir="rtl">‭...(3) [a]‬</div> + <div dir="rtl">‭...(3) [a]‬</div> + <div dir="rtl">‭...(3) [a]‬</div> + </div> + <div class="ref"> + <div dir="ltr">‭[א] (3 reviews)...‬</div> + <div dir="ltr">‭[א] (3 reviews)...‬</div> + <div dir="ltr">‭[א] (3 reviews)...‬</div> + <div dir="rtl">‭...(3) [a]‬</div> + <div dir="rtl">‭...(3) [a]‬</div> + <div dir="rtl">‭...(3) [a]‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-1.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-1.html new file mode 100644 index 0000000000..ff566737f2 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-1.html @@ -0,0 +1,54 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"/> + <title>HTML Test: BDI: neutral to following number</title> + <link rel="match" href="bdi-neutral-to-number-following-1-ref.html"/> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/> + <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com"/> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/> + <meta name="assert" content=" + 'For the purposes of applying the bidirectional algorithm to the paragraph-level + container that a bdi element finds itself within, the bdi element must be treated + like a U+FFFC OBJECT REPLACEMENT CHARACTER.'"/> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + If the BDI in the test's first DIV were a SPAN, the 3 would be rendered to the left + of the א + </div> + <div class="test"> + <div dir="ltr"><bdi>[א]</bdi> (3 reviews)...</div> + <div dir="ltr"><bdi dir="rtl">[א]</bdi> (3 reviews)...</div> + <div dir="ltr"><bdi dir="ltr">[א]</bdi> (3 reviews)...</div> + <div dir="rtl"><bdi>[a]</bdi> (3)...</div> + <div dir="rtl"><bdi dir="ltr">[a]</bdi> (3)...</div> + <div dir="rtl"><bdi dir="rtl">[a]</bdi> (3)...</div> + </div> + <div class="ref"> + <div dir="ltr">‭[א] (3 reviews)...‬</div> + <div dir="ltr">‭[א] (3 reviews)...‬</div> + <div dir="ltr">‭[א] (3 reviews)...‬</div> + <div dir="rtl">‭...(3) [a]‬</div> + <div dir="rtl">‭...(3) [a]‬</div> + <div dir="rtl">‭...(3) [a]‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-2-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-2-ref.html new file mode 100644 index 0000000000..d0f1097ade --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-2-ref.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"> + <link rel="author" title="Shai Berger" href="mailto:shai@platonix.com"> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + </div> + <div class="test"> + <div dir="ltr">‭א1...‬</div> + <div dir="ltr">‭א1...‬</div> + <div dir="ltr">‭א1...‬</div> + <div dir="rtl">‭...1a‬</div> + <div dir="rtl">‭...1a‬</div> + <div dir="rtl">‭...1a‬</div> + </div> + <div class="ref"> + <div dir="ltr">‭א1...‬</div> + <div dir="ltr">‭א1...‬</div> + <div dir="ltr">‭א1...‬</div> + <div dir="rtl">‭...1a‬</div> + <div dir="rtl">‭...1a‬</div> + <div dir="rtl">‭...1a‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-2.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-2.html new file mode 100644 index 0000000000..62a3b50ffe --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-number-following-2.html @@ -0,0 +1,53 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"/> + <title>HTML Test: BDI: neutral to immediately following number</title> + <link rel="match" href="bdi-neutral-to-number-following-2-ref.html"/> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/> + <meta name="assert" content=" + 'For the purposes of applying the bidirectional algorithm to the paragraph-level + container that a bdi element finds itself within, the bdi element must be treated + like a U+FFFC OBJECT REPLACEMENT CHARACTER.'"/> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + If the BDI in the test's first DIV were a SPAN, the 1 would be rendered to the left + of the א + </div> + <div class="test"> + <div dir="ltr"><bdi>א</bdi>1...</div> + <div dir="ltr"><bdi dir="rtl">א</bdi>1...</div> + <div dir="ltr"><bdi dir="ltr">א</bdi>1...</div> + <div dir="rtl"><bdi>a</bdi>1...</div> + <div dir="rtl"><bdi dir="ltr">a</bdi>1...</div> + <div dir="rtl"><bdi dir="rtl">a</bdi>1...</div> + </div> + <div class="ref"> + <div dir="ltr">‭א1...‬</div> + <div dir="ltr">‭א1...‬</div> + <div dir="ltr">‭א1...‬</div> + <div dir="rtl">‭...1a‬</div> + <div dir="rtl">‭...1a‬</div> + <div dir="rtl">‭...1a‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-surrounding-run-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-surrounding-run-ref.html new file mode 100644 index 0000000000..d7967c77fc --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-surrounding-run-ref.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + </div> + <div class="test"> + <div dir="ltr">‭ג < [b] < א...‬</div> + <div dir="ltr">‭ג < [b] < א...‬</div> + <div dir="ltr">‭ג < [b] < א...‬</div> + <div dir="rtl">‭...a > [ב] > c‬</div> + <div dir="rtl">‭...a > [ב] > c‬</div> + <div dir="rtl">‭...a > [ב] > c‬</div> + </div> + <div class="ref"> + <div dir="ltr">‭ג < [b] < א...‬</div> + <div dir="ltr">‭ג < [b] < א...‬</div> + <div dir="ltr">‭ג < [b] < א...‬</div> + <div dir="rtl">‭...a > [ב] > c‬</div> + <div dir="rtl">‭...a > [ב] > c‬</div> + <div dir="rtl">‭...a > [ב] > c‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-surrounding-run.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-surrounding-run.html new file mode 100644 index 0000000000..bff339ec34 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-to-surrounding-run.html @@ -0,0 +1,56 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"/> + <title>HTML Test: BDI: neutral to surrounding letters</title> + <link rel="match" href="bdi-neutral-to-surrounding-run-ref.html"> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/> + <meta name="assert" content=" + 'For the purposes of applying the bidirectional algorithm to the paragraph-level + container that a bdi element finds itself within, the bdi element must be treated + like a U+FFFC OBJECT REPLACEMENT CHARACTER.' + Thus, regardless of its content and its dir attribute (if any), a BDI will not prevent + a strongly RTL (or LTR) character preceding it from forming a single directional run with + another strongly RTL (LTR) character following it."/> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - 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 א and the ב + from forming a single RTL run and thus keep the >s between from being mirrored into <s. + </div> + <div class="test"> + <div dir="ltr">א > <bdi>[b]</bdi> > ג...</div> + <div dir="ltr">א > <bdi dir="ltr">[b]</bdi> > ג...</div> + <div dir="ltr">א > <bdi dir="rtl">[b]</bdi> > ג...</div> + <div dir="rtl">a > <bdi>[ב]</bdi> > c...</div> + <div dir="rtl">a > <bdi dir="ltr">[ב]</bdi> > c...</div> + <div dir="rtl">a > <bdi dir="rtl">[ב]</bdi> > c...</div> + </div> + <div class="ref"> + <div dir="ltr">‭ג < [b] < א...‬</div> + <div dir="ltr">‭ג < [b] < א...‬</div> + <div dir="ltr">‭ג < [b] < א...‬</div> + <div dir="rtl">‭...a > [ב] > c‬</div> + <div dir="rtl">‭...a > [ב] > c‬</div> + <div dir="rtl">‭...a > [ב] > c‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-wrapped-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-wrapped-ref.html new file mode 100644 index 0000000000..9859de4747 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-wrapped-ref.html @@ -0,0 +1,52 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + </div> + <div class="test"> + <div dir="ltr"> + ‭b < א‬<br/> + ‭>>>‬<br/> + ‭ד < c...‬ + </div> + <div dir="rtl"> + ‭a > ב‬<br/> + ‭<<<‬<br/> + ‭...ג > d‬ + </div> + </div> + <div class="ref"> + <div dir="ltr"> + ‭b < א‬<br/> + ‭>>>‬<br/> + ‭ד < c...‬ + </div> + <div dir="rtl"> + ‭a > ב‬<br/> + ‭<<<‬<br/> + ‭...ג > d‬ + </div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-wrapped.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-wrapped.html new file mode 100644 index 0000000000..3e21fcb0fd --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-wrapped.html @@ -0,0 +1,73 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"/> + <title>HTML Test: BDI: neutral when wrapped</title> + <link rel="match" href="bdi-neutral-wrapped-ref.html"> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/> + <meta name="assert" content=" + 'For the purposes of applying the bidirectional algorithm to the paragraph-level + container that a bdi element finds itself within, the bdi element must be treated + like a U+FFFC OBJECT REPLACEMENT CHARACTER.' + This should hold even if the BDI's content is wrapped over more than one line."/> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: +   - Non-breaking space. + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + In the test below, the non-breaking spaces in the BDI's middle "word" make it so long that it + must be displayed on a line of its own, with the BDI wrapped before and after it. At the same + time, the content surrounding the BDI is supposed to form a single directional run, despite + the containing element and the BDI both having the opposite direction, because the BDI must be + treated as a neutral. Thus, on the line containing the first part of the BDI, the BDI's + content must appear after the content preceding it, and on the line containing the last part + of the BDI, the BDI content must appear before the content following it, where both 'before' + and 'after' are defined relative to the surrounding directional run. + </div> + <div class="test"> + <div dir="ltr"> + א > + <bdi>b +>>>                                                  + c</bdi> + > ד... + </div> + <div dir="rtl"> + a > + <bdi>ב +>>>                                                  + ג</bdi> + > d... + </div> + </div> + <div class="ref"> + <div dir="ltr"> + ‭b < א‬<br/> + ‭>>>‬<br/> + ‭ד < c...‬ + </div> + <div dir="rtl"> + ‭a > ב‬<br/> + ‭<<<‬<br/> + ‭...ג > d‬ + </div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-paragraph-level-container-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-paragraph-level-container-ref.html new file mode 100644 index 0000000000..0c74ecf68a --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-paragraph-level-container-ref.html @@ -0,0 +1,36 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 500px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + </div> + <div class="test"> + <div dir="ltr">‭א [1 2 3 b] c [d ה?!] ו...‬</div> + <div dir="rtl">‭...f [!?e ד] ג [ב 3 2 1] a‬</div> + </div> + <div class="ref"> + <div dir="ltr">‭א [1 2 3 b] c [d ה?!] ו...‬</div> + <div dir="rtl">‭...f [!?e ד] ג [ב 3 2 1] a‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-paragraph-level-container.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-paragraph-level-container.html new file mode 100644 index 0000000000..f133a95772 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdi-element/bdi-paragraph-level-container.html @@ -0,0 +1,46 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"/> + <title>HTML Test: BDI: paragraph-level container</title> + <link rel="match" href="bdi-paragraph-level-container-ref.html"/> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com"/> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdi-element"/> + <meta name="assert" content=" + 'For the purposes of applying the bidirectional algorithm to the contents of a bdi element, + user agents must treat the element as a paragraph-level container.' + Thus, under no circumstances should the content outside a BDI affect the visual + ordering of the BDI's content."/> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 500px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ו - The first six Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + If the BDIs in the test's first DIV were just SPANs, the א would order the 1 2 3 as + 3 2 1, and the ו would (with the ה) order the ?! as !?. + </div> + <div class="test"> + <div dir="ltr">א <bdi>[1 2 3 b]</bdi> c <bdi>[d ה?!]</bdi> ו...</div> + <div dir="rtl">a <bdi>[1 2 3 ב]</bdi> ג <bdi>[ד e?!]</bdi> f...</div> + </div> + <div class="ref"> + <div dir="ltr">‭א [1 2 3 b] c [d ה?!] ו...‬</div> + <div dir="rtl">‭...f [!?e ד] ג [ב 3 2 1] a‬</div> + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bdo-child.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bdo-child.html new file mode 100644 index 0000000000..feadc26d7b --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bdo-child.html @@ -0,0 +1,17 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <title>HTML Test: bdo - text directionality formatting control for its children</title> + <link rel="author" title="Intel" href="http://www.intel.com/"> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdo-element"> + <link rel="match" href="bidi-001-ref.html"> + <meta name="assert" content="Check if the bdo element represents explicit text directionality formatting control for its children."> + </head> + <body> + <p>Test passes if there is text 'WERBEH'.</p> + <bdo dir="rtl"> + <span>HEBREW</span> + </bdo> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bdo-ltr.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bdo-ltr.html new file mode 100644 index 0000000000..8a7861086a --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bdo-ltr.html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <title>HTML Test: The value 'ltr' of dir attribute specifies a left-to-right override</title> + <link rel="author" title="Intel" href="http://www.intel.com/"> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdo-element"> + <link rel="match" href="bidi-001-ref.html"> + <meta name="assert" content="Check if the value ltr of dir attribute specifies a left-to-right override"> + </head> + <body> + <p>Test passes if there is text 'WERBEH'.</p> + <bdo dir="ltr">WERBEH</bdo> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bdo-override.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bdo-override.html new file mode 100644 index 0000000000..75a45e198f --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bdo-override.html @@ -0,0 +1,18 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <title>HTML Test: bdo - override the Unicode bidirectional algorithm</title> + <link rel="author" title="Intel" href="http://www.intel.com/"> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-bdo-element"> + <link rel="match" href="bidi-001-ref.html"> + <meta name="assert" content="Check if authors could override the Unicode bidirectional algorithm + by explicitly specifying a direction override of bdo element"> + </head> + <body> + <p>Test passes if there is text 'WERBEH'.</p> + <p> + ‮<bdo dir="ltr">WERBEH</bdo>‬ + </p> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bidi-001-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bidi-001-ref.html new file mode 100644 index 0000000000..83d2dc4a16 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bidi-001-ref.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="UTF-8"> +<title>directional type reference</title> +</head> +<body> +<p>Test passes if there is text 'WERBEH'.</p> +<div>WERBEH</div> +</body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bidi-001.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bidi-001.html new file mode 100644 index 0000000000..772dcf43b3 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-bdo-element/bidi-001.html @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="UTF-8"> +<title>directional type</title> +<meta content="W3C" name="author"> +<link rel="match" href="bidi-001-ref.html"> +<meta name="assert" content="Test text bidirectionality using the bdo element"> +</head> +<body dir='ltr'> +<p>Test passes if there is text 'WERBEH'.</p> +<bdo dir="rtl">HEBREW</bdo> +</body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi-in-inline-ancestors-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi-in-inline-ancestors-ref.html new file mode 100644 index 0000000000..c2dd4daa7a --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi-in-inline-ancestors-ref.html @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8" /> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" /> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ט - The first nine Hebrew letters (strongly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + </div> + <div class="test"> + ‭אב גד 1. I like ה. fg hi‬ + <br/> + ‭ab cd 2. ה is great! וז חט‬ + </div> + <div class="ref"> + ‭אב גד 1. I like ה. fg hi‬ + <br/> + ‭ab cd 2. ה is great! וז חט‬ + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi-in-inline-ancestors.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi-in-inline-ancestors.html new file mode 100644 index 0000000000..89e7f2f1aa --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi-in-inline-ancestors.html @@ -0,0 +1,59 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8" /> + <title>HTML Test: BR in inline ancestors</title> + <link rel="match" href="br-bidi-in-inline-ancestors-ref.html"> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/> + <link rel="author" title="HTML5 bidi test WG" href="mailto:html5bidi@googlegroups.com" /> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-br-element"/> + <link rel="help" href="http://www.w3.org/TR/css3-writing-modes/#unicode-bidi" /> + <meta name="assert" content=" + 'A br element should separate paragraphs for the purposes of the Unicode bidirectional + algorithm.' + 'If an inline element is broken around a bidi paragraph boundary (e.g. if split by a block or + forced paragraph break), then the bidi control codes corresponding to the end of the element + are added before the interruption and the codes corresponding to the start of the element are + added after it. (In other words, any embedding levels or overrides started by the element are + closed at the paragraph break and reopened on the other side of it.)'" /> + <style> + body{ + font-size:2em; + } + .test, .ref { + border: medium solid gray; + width: 400px; + margin: 20px; + } + .comments { display: none; } + </style> + </head> + <body> + <div class="instructions"><p>Test passes if the two boxes below look exactly the same.</p></div> + <div class="comments"> + Key to entities used below: + א ... ט - The first nine Hebrew letters (strongly RTL). + ‎ - The LRM (left-to-right mark) formatting character (invisible, stronly LTR). + ‏ - The RLM (right-to-left mark) formatting character (invisible, stronly RTL). + ‭ - The LRO (left-to-right override) formatting character. + ‬ - The PDF (pop directional formatting) formatting character; closes LRO. + </div> + <div class="test"> + בא‎ + <bdo dir="rtl">ih + <bdo dir="ltr">גד + <span dir="rtl">fg‏ + <span dir="ltr">1. I like ה.<br/> + 2. ה is great!</span> + ‏cd</span> + וז</bdo> + ba</bdo> + ‎טח + </div> + <div class="ref"> + ‭אב גד 1. I like ה. fg hi‬ + <br/> + ‭ab cd 2. ה is great! וז חט‬ + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi-ref.html new file mode 100644 index 0000000000..f07c077917 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi-ref.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> + <head> + <title>HTML Test reference: BR separates bidi paragraph</title> + <link rel="author" title="Amir E. Aharoni" href="mailto:amir.aharoni@mail.huji.ac.il"/> + <link rel="author" title="Eyal Sela" href="mailto:eyal@post.isoc.org.il"/> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-br-element"/> + </head> + <body> + <div class="instructions"><p>Test passes if the rightmost character in the first line below is a full stop and to the left of it is a Hebrew letter.</p></div> + <div class="test"> + A Hebrew letter and a full stop: א.‎ + <br /> + א this line begins with a Hebrew letter. + </div> +</p> +</body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi.html new file mode 100644 index 0000000000..1dfa6836f3 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-br-element/br-bidi.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"/> + <title>HTML Test: BR separates bidi paragraph</title> + <link rel="match" href="br-bidi-ref.html"> + <link rel="author" title="Amir E. Aharoni" href="mailto:amir.aharoni@mail.huji.ac.il"/> + <link rel="author" title="Eyal Sela" href="mailto:eyal@post.isoc.org.il"/> + <link rel="author" title="Aharon Lanin" href="mailto:aharon@google.com"/> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-br-element"/> + <meta name="assert" + content="A br element should separate paragraphs for the purposes of the Unicode bidirectional algorithm."/> + </head> + <body> + <div class="instructions"><p>Test passes if the rightmost character in the first line below is a full stop and to the left of it is a Hebrew letter.</p></div> + <div class="test"> + A Hebrew letter and a full stop: א. + <br /> + א this line begins with a Hebrew letter. + </div> + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-ruby-element/rt-without-ruby-crash.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-ruby-element/rt-without-ruby-crash.html new file mode 100644 index 0000000000..3caed3a02e --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-ruby-element/rt-without-ruby-crash.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> +<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=967255"> +<rt style="display:block;"> + <div></div> +</rt> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script> + test(()=> { }, "No crash"); +</script> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-ruby-element/ruby-usage-notref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-ruby-element/ruby-usage-notref.html new file mode 100644 index 0000000000..f5747811ae --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-ruby-element/ruby-usage-notref.html @@ -0,0 +1,6 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>HTML Reference File</title> +<link rel="author" title="Intel" href="http://www.intel.com/"> + +<p>君くん子しは和わして同どうぜず</p> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-ruby-element/ruby-usage.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-ruby-element/ruby-usage.html new file mode 100644 index 0000000000..59c076cd09 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-ruby-element/ruby-usage.html @@ -0,0 +1,8 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>HTML test: ruby - mark phrasing content</title> +<link rel="author" title="Intel" href="http://www.intel.com/"> +<link rel="mismatch" href="ruby-usage-notref.html"> +<link rel="help" href="https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-ruby-element"/> + +<p><ruby>君<rt>くん</ruby><ruby>子<rt>し</ruby>は<ruby>和<rt>わ</ruby>して<ruby>同<rt>どう</ruby>ぜず</p> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-time-element/001.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-time-element/001.html new file mode 100644 index 0000000000..e1cd0480ac --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-time-element/001.html @@ -0,0 +1,68 @@ +<!doctype html> +<html> + <head> + <meta charset=utf-8> + <title>HTML time element API</title> + <style> +#time { visibility: hidden; } + </style> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-time-element"> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id="log"></div> + <!-- intentionally nested to test parsing rules --> + <p id="time"><time pubdate datetime="2000-02-01T03:04:05Z">Dummy text <time>2001-06-07T<time>08:09<time></time></time>Z</time></time></p> + <script type="text/javascript"> +function makeTime(dateTime,contents,dateTimeProp) { + var timeEl = document.createElement('time'); + if( dateTime ) { + timeEl.setAttribute('datetime',dateTime); + } + if( contents ) { + timeEl.innerHTML = contents; + } + if( dateTimeProp ) { + timeEl.dateTime = dateTimeProp; + } + return timeEl; +} + +var timep = document.getElementById('time'); +var times = timep.getElementsByTagName('time'); + +//TIME elements +test(function () { + assert_equals( times.length, 4 ); +}, 'HTML parsing should locate 4 time elements in this document'); +test(function () { + assert_true( !!window.HTMLTimeElement ); +}, 'HTMLTimeElement should be exposed for prototyping'); +test(function () { + assert_true( makeTime() instanceof window.HTMLTimeElement, 'createElement variant' ); + assert_true( times[0] instanceof window.HTMLTimeElement, 'HTML parsing variant' ); +}, 'the time elements should be instanceof HTMLTimeElement'); + +//dateTime +test(function () { + assert_equals( makeTime('2000-02-01T03:04:05Z','2001-02-01T03:04:05Z').dateTime, '2000-02-01T03:04:05Z' ); +}, 'the datetime attribute should be reflected by the .dateTime property'); +test(function () { + assert_equals( typeof makeTime().dateTime, 'string', 'typeof test' ); + assert_equals( makeTime().dateTime, '', 'value test' ); +}, 'the dateTime IDL property should default to an empty string'); +test(function () { + assert_equals( makeTime(false,false,'2000-02-01T03:04:05Z').dateTime, '2000-02-01T03:04:05Z' ); +}, 'the dateTime property should be read/write'); +test(function () { + assert_equals( makeTime('go fish').dateTime, 'go fish' ); +}, 'the datetime attribute should be reflected by the .dateTime property even if it is invalid'); +test(function () { + assert_equals( makeTime(false,'2000-02-01T03:04:05Z').dateTime, '' ); +}, 'the datetime attribute should not reflect the textContent'); + + </script> + + </body> +</html> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-wbr-element/wbr-element-ref.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-wbr-element/wbr-element-ref.html new file mode 100644 index 0000000000..bedb6d62e8 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-wbr-element/wbr-element-ref.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<title>The wbr element</title> +<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org"> +<meta name="flags" content="ahem"> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<style> + p {font:15px/1 Ahem;} +</style> +<p>Loremipsumdolorsit<br>amet,consectetur<br>adipisicingelit,sed<br>doeiusmodtempor<br>incididuntutlaboreet<br>doloremagnaaliqua.Ut<br>enimadminimveniam,<br>quisnostrud<br>exercitationullamco<br>laborisnisiutaliquip<br>exeacommodo<br>consequat.Duisaute<br>iruredolorin<br>reprehenderitin<br>voluptatevelitesse<br>cillumdoloreeufugiat<br>nullapariatur.<br>Excepteursint<br>occaecatcupidatatnon<br>proident,suntinculpa<br>quiofficiadeserunt<br>mollitanimidest<br>laborum.</p> diff --git a/testing/web-platform/tests/html/semantics/text-level-semantics/the-wbr-element/wbr-element.html b/testing/web-platform/tests/html/semantics/text-level-semantics/the-wbr-element/wbr-element.html new file mode 100644 index 0000000000..aa3912028e --- /dev/null +++ b/testing/web-platform/tests/html/semantics/text-level-semantics/the-wbr-element/wbr-element.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<title>The wbr element</title> +<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org"> +<link rel=help href="https://html.spec.whatwg.org/multipage/#rendering"> +<link rel="match" href="wbr-element-ref.html"> +<meta name="flags" content="ahem"> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<style> + p {max-width: 300px; font:15px/1 Ahem;} +</style> +<p>AHEM_<wbr>ipsum<wbr>dolor<wbr>sit<wbr>amet,<wbr>consectetur<wbr>adipisicing<wbr>elit,<wbr>sed<wbr>do<wbr>eiusmod<wbr>tempor<wbr>incididunt<wbr>ut<wbr>labore<wbr>et<wbr>dolore<wbr>magna<wbr>aliqua.<wbr>Ut<wbr>enim<wbr>ad<wbr>minim<wbr>veniam,<wbr>quis<wbr>nostrud<wbr>exercitation<wbr>ullamco<wbr>laboris<wbr>nisi<wbr>ut<wbr>aliquip<wbr>ex<wbr>ea<wbr>commodo<wbr>consequat.<wbr>Duis<wbr>aute<wbr>irure<wbr>dolor<wbr>in<wbr>reprehenderit<wbr>in<wbr>voluptate<wbr>velit<wbr>esse<wbr>cillum<wbr>dolore<wbr>eu<wbr>fugiat<wbr>nulla<wbr>pariatur.<wbr>Excepteur<wbr>sint<wbr>occaecat<wbr>cupidatat<wbr>non<wbr>proident,<wbr>sunt<wbr>in<wbr>culpa<wbr>qui<wbr>officia<wbr>deserunt<wbr>mollit<wbr>anim<wbr>id<wbr>est<wbr>laborum.</p> |