summaryrefslogtreecommitdiffstats
path: root/layout/reftests/bidi/unicode-bidi-isolate-basic.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /layout/reftests/bidi/unicode-bidi-isolate-basic.js
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/reftests/bidi/unicode-bidi-isolate-basic.js')
-rw-r--r--layout/reftests/bidi/unicode-bidi-isolate-basic.js44
1 files changed, 44 insertions, 0 deletions
diff --git a/layout/reftests/bidi/unicode-bidi-isolate-basic.js b/layout/reftests/bidi/unicode-bidi-isolate-basic.js
new file mode 100644
index 0000000000..e949e6a445
--- /dev/null
+++ b/layout/reftests/bidi/unicode-bidi-isolate-basic.js
@@ -0,0 +1,44 @@
+function buildTable()
+{
+ var seed = 0;
+
+ var neutrals = ['"', ")", "("];
+ var strongRTLs = ['א', 'ב', 'ג', 'ד', 'ה', 'ו', 'ז'];
+ var strongLTRs = ['a', 'b', 'c', 'd', 'e', 'f', 'g'];
+ var neutral = function() { return neutrals[seed++ % neutrals.length]; }
+ var strongRTL = function() { return strongRTLs[seed++ % strongRTLs.length]; }
+ var strongLTR = function() { return strongLTRs[seed++ % strongLTRs.length]; }
+ var charClassExamples = [neutral, strongRTL, strongLTR];
+ var possibleDirs = ['ltr', 'rtl'];
+
+ var elem=document.getElementById("elem");
+ for (outerDirIndex in possibleDirs) {
+ var outerDir = possibleDirs[outerDirIndex];
+ for (beforeSpanIndex in charClassExamples) {
+ var beforeSpan = charClassExamples[beforeSpanIndex];
+ for (spanDirIndex in possibleDirs) {
+ var spanDir = possibleDirs[spanDirIndex];
+ for (inSpanIndex in charClassExamples) {
+ var inSpan = charClassExamples[inSpanIndex];
+ for (afterSpanIndex in charClassExamples) {
+ var afterSpan = charClassExamples[afterSpanIndex];
+ function caseWithStyle() {
+ seed = 0;
+ var outerDiv = document.createElement("div");
+ outerDiv.dir = outerDir;
+ outerDiv.appendChild(document.createTextNode(beforeSpan()));
+ var span = document.createElement("span");
+ span.dir = spanDir;
+ span.setAttribute("class", "enclosed")
+ span.appendChild(document.createTextNode(inSpan()));
+ outerDiv.appendChild(span);
+ outerDiv.appendChild(document.createTextNode(afterSpan()));
+ return outerDiv;
+ }
+ elem.appendChild(caseWithStyle());
+ }
+ }
+ }
+ }
+ }
+}