author | Simon Montagu <smontagu@smontagu.org> |
Mon, 23 Apr 2012 11:48:33 +0300 | |
changeset 92119 | d8d124d2a76c57bffed5972003470b4da218e839 |
parent 92118 | ee415e3f509d36f663a2abdbe99dfb7d94f63d31 |
child 92120 | af0733d23b87aaf51477a58afa08f716ab3b6402 |
push id | 22516 |
push user | eakhgari@mozilla.com |
push date | Mon, 23 Apr 2012 22:53:29 +0000 |
treeherder | mozilla-central@8acbbeca4f42 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | roc |
bugs | 706194 |
milestone | 14.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
new file mode 100644 --- /dev/null +++ b/layout/reftests/bidi/bdi-element-ref.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +</head> +<body> +<p> + From WebKit <a href='https://bugs.webkit.org/show_bug.cgi?id=50913'>bug 50913</a> +</p> +<p> +In this example, usernames are shown along with the number of posts that the user has submitted. If the bdi element were not used, the username of the Arabic user would end up confusing the text (the bidirectional algorithm would put the colon and the number "3" next to the word "User" rather than next to the word "posts"). +</p> +<ul> + <li><bdo dir="ltr">User jcranmer: 12 posts.</bdo> + <li><bdo dir="ltr">User hober: 5 posts.</bdo> + <li><bdo dir="ltr">User نايإ: 3 posts.</bdo> +</ul> +</body> +</html>
new file mode 100644 --- /dev/null +++ b/layout/reftests/bidi/bdi-element.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +</head> +<body> +<p> + From WebKit <a href='https://bugs.webkit.org/show_bug.cgi?id=50913'>bug 50913</a> +</p> +<p> +In this example, usernames are shown along with the number of posts that the user has submitted. If the bdi element were not used, the username of the Arabic user would end up confusing the text (the bidirectional algorithm would put the colon and the number "3" next to the word "User" rather than next to the word "posts"). +</p> +<ul> + <li>User <bdi>jcranmer</bdi>: 12 posts. + <li>User <bdi>hober</bdi>: 5 posts. + <li>User <bdi>إيان</bdi>: 3 posts. +</ul> +</body> +</html>
--- a/layout/reftests/bidi/reftest.list +++ b/layout/reftests/bidi/reftest.list @@ -1,8 +1,9 @@ +== bdi-element.html bdi-element-ref.html == bidi-000.html bidi-000-ref.html == bidi-001.html bidi-001-ref.html == bidi-001-j.html bidi-001-ref.html == bidi-001-v.html bidi-001-ref.html == bidi-002.html bidi-002-ref.html fails-if(Android) == bidi-003.html bidi-003-ref.html # bug 736726 == bidi-004.html bidi-004-ref.html == bidi-004-j.html bidi-004-ref.html @@ -27,16 +28,23 @@ random-if(cocoaWidget) == mirroring-02.h == mixedChartype-01.html mixedChartype-01-ref.html == mixedChartype-01-j.html mixedChartype-01-ref.html == mixedChartype-02.html mixedChartype-02-ref.html == mixedChartype-02-j.html mixedChartype-02-ref.html == mixedChartype-03.html mixedChartype-03-ref.html == mixedChartype-03-j.html mixedChartype-03-ref.html == unicode-bidi-anonymous-001.html unicode-bidi-anonymous-001-ref.html == unicode-bidi-anonymous-002.html unicode-bidi-anonymous-002-ref.html +== unicode-bidi-isolate-basic.html unicode-bidi-isolate-basic-ref.html +== unicode-bidi-isolate-aharon.html unicode-bidi-isolate-aharon-ref.html +== unicode-bidi-plaintext.html unicode-bidi-plaintext-ref.html +== unicode-bidi-plaintext-textarea-1.html unicode-bidi-plaintext-textarea-ref.html +== unicode-bidi-plaintext-textarea-2.html unicode-bidi-plaintext-textarea-ref.html +== unicode-bidi-plaintext-textarea-3.html unicode-bidi-plaintext-textarea-ref.html +== unicode-bidi-plaintext-textarea-4.html unicode-bidi-plaintext-textarea-ref.html == with-first-letter-1a.html with-first-letter-1-ref.html == with-first-letter-1b.html with-first-letter-1-ref.html random-if(cocoaWidget) == with-first-letter-2a.html with-first-letter-2-ref.html # bug 734313 random-if(cocoaWidget) == with-first-letter-2b.html with-first-letter-2-ref.html # bug 734313 == 83958-1a.html 83958-1-ref.html == 83958-1b.html 83958-1-ref.html == 83958-1c.html 83958-1-ref.html fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!layersGPUAccelerated) == 83958-2a.html 83958-2-ref.html # bug 696671
new file mode 100644 --- /dev/null +++ b/layout/reftests/bidi/unicode-bidi-isolate-aharon-ref.html @@ -0,0 +1,69 @@ +<!DOCTYPE html> +<html><head> +<title>Test cases for unicode-bidi:isolate</title> +<style> +</style> +</head><body> +opposite-to-base isolate followed by number. +<div> + <div class="reference"> + <span dir="ltr">א</span> (3 reviews) + </div> +</div> +<hr> +opposite-to-base isolate with opposite-to-base text before it with neutrals in between. +<div> + <div class="reference"> + <span dir="ltr">א</span>: <span dir="ltr">ב</span> + </div> +</div> +<hr> +opposite-to-base isolate with opposite-to-base text before it and nothing in between. +<div> + <div class="reference"> + <bdo dir="ltr">אב</bdo> + </div> +</div> +<hr> +two opposite-to-base isolates with neutrals in between. +<div> + <div class="reference"> + <span dir="ltr">א</span> = <span dir="ltr">ב</span> + </div> +</div> +<hr> +two opposite-to-base isolates with nothing in between. +<div> + <div class="reference"> + <bdo dir="ltr">אב</bdo> + </div> +</div> +<hr> +same-as-base isolate preceded by opposite-to-base text and followed by number +<div dir="rtl"> + <div class="reference"> + see <span dir="ltr">א</span><sup>3</sup> + </div> +</div> +<hr> +same-as-base isolate surrounded by opposite-to-base text +<div dir="rtl"> + <div class="reference"> + with <span dir="ltr">א</span>=<span dir="ltr">ב</span> everywhere + </div> +</div> +<hr> +chimeric isolate surrounded by chimeric text +<div> + <div class="reference"> + about that <span dir="ltr">א</span> - ב + </div> +</div> +<hr> +nested chimeric isolates surrounded by chimeric text +<div> + <div class="reference"> + about that strange <span dir="ltr">א</span> - <span dir="ltr">ב</span> - ג + </div> +</div> +</body></html>
new file mode 100644 --- /dev/null +++ b/layout/reftests/bidi/unicode-bidi-isolate-aharon.html @@ -0,0 +1,74 @@ +<!DOCTYPE html> +<html><head> +<title>Test cases for unicode-bidi:isolate</title> +<style> + .isolate { + unicode-bidi: -webkit-isolate; + unicode-bidi: -moz-isolate; + unicode-bidi: isolate; + } +</style> +</head><body> +opposite-to-base isolate followed by number. +<div> + <div class="test"> + <span class="isolate">א</span> (3 reviews) + </div> +</div> +<hr> +opposite-to-base isolate with opposite-to-base text before it with neutrals in between. +<div> + <div class="test"> + א: <span class="isolate">ב</span> + </div> +</div> +<hr> +opposite-to-base isolate with opposite-to-base text before it and nothing in between. +<div> + <div class="test"> + א<span class="isolate">ב</span> + </div> +</div> +<hr> +two opposite-to-base isolates with neutrals in between. +<div> + <div class="test"> + <span class="isolate">א</span> = <span class="isolate">ב</span> + </div> +</div> +<hr> +two opposite-to-base isolates with nothing in between. +<div> + <div class="test"> + <span class="isolate">א</span><span class="isolate">ב</span> + </div> +</div> +<hr> +same-as-base isolate preceded by opposite-to-base text and followed by number +<div dir="rtl"> + <div class="test"> + see <span class="isolate">א</span><sup>3</sup> + </div> +</div> +<hr> +same-as-base isolate surrounded by opposite-to-base text +<div dir="rtl"> + <div class="test"> + with <span class="isolate">א</span>=<span class="isolate">ב</span> everywhere + </div> +</div> +<hr> +chimeric isolate surrounded by chimeric text +<div> + <div class="test"> + about <span class="isolate">that א</span> - ב + </div> +</div> +<hr> +nested chimeric isolates surrounded by chimeric text +<div> + <div class="test"> + about <span class="isolate">that <span class="isolate">strange א</span> - ב</span> - ג + </div> +</div> +</body></html>
new file mode 100644 --- /dev/null +++ b/layout/reftests/bidi/unicode-bidi-isolate-basic-ref.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html> +<head> +<meta http-equiv="content-type" content="text/html; charset=UTF-8"> +<script type="text/javascript" src="unicode-bidi-isolate-basic.js"></script> +<style> +.resultsDiv { + -moz-column-width: 3em; + -webkit-column-width: 3em; + -moz-column-gap: 5em; + -webkit-column-gap: 5em; +} +.enclosed { display: inline-block; } +</style> +</head> +<body onload="buildTable();"> +<div id="resultsContainer" style="position: relative"> +<div id="elem" class="resultsDiv"></div> +</div> +</body> +</html>
new file mode 100644 --- /dev/null +++ b/layout/reftests/bidi/unicode-bidi-isolate-basic.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html> +<head> +<meta http-equiv="content-type" content="text/html; charset=UTF-8"> +<script type="text/javascript" src="unicode-bidi-isolate-basic.js"></script> +<style> +.resultsDiv { + -moz-column-width: 3em; + -webkit-column-width: 3em; + -moz-column-gap: 5em; + -webkit-column-gap: 5em; +} +.enclosed { unicode-bidi: -moz-isolate; } +</style> +</head> +<body onload="buildTable()"> +<div id="resultsContainer" style="position: relative"> +<div id="elem" class="resultsDiv"></div> +</div> +</body> +</html>
new file mode 100644 --- /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()); + } + } + } + } + } +}
new file mode 100644 --- /dev/null +++ b/layout/reftests/bidi/unicode-bidi-plaintext-ref.html @@ -0,0 +1,26 @@ +<!DOCTYPE html> +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +</head> +<body> +<div> +!hello.<br> +<span dir=rtl> +!שלום. +</span><br> +<span dir=ltr> +hello, לוי! +</span><br> +<span dir=rtl> +שלום, WebKit!</span><br> +<pre> +a +( +!WebKit ,שלום +hello, לוי! +) +</pre> +</div> +</body> +</html>
new file mode 100644 --- /dev/null +++ b/layout/reftests/bidi/unicode-bidi-plaintext-textarea-1.html @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<html><head> +<title>unicode-bidi:plaintext</title> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +</head><body> +<div> +The exclamation mark should be on the left side of the first line +and on the right side of the second line. +</div> +<textarea rows=4 cols=50 dir=auto> +שלום! +hello! +</textarea> +</body></html>
new file mode 100644 --- /dev/null +++ b/layout/reftests/bidi/unicode-bidi-plaintext-textarea-2.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html><head> +<title>unicode-bidi:plaintext</title> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<style> + .plaintext { + unicode-bidi:-webkit-plaintext; + unicode-bidi:-moz-plaintext; + unicode-bidi:plaintext; + } +</style> +</head><body> +<div> +The exclamation mark should be on the left side of the first line +and on the right side of the second line. +</div> +<textarea rows=4 cols=50 class="plaintext"> +שלום! +hello! +</textarea> +</body></html>
new file mode 100644 --- /dev/null +++ b/layout/reftests/bidi/unicode-bidi-plaintext-textarea-3.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html><head> +<title>unicode-bidi:plaintext</title> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<style> + .plaintext { + unicode-bidi:-webkit-plaintext; + unicode-bidi:-moz-plaintext; + unicode-bidi:plaintext; + } +</style> +</head><body> +<div> +The exclamation mark should be on the left side of the first line +and on the right side of the second line. +</div> +<textarea rows=4 cols=50 dir="ltr" class="plaintext"> +שלום! +hello! +</textarea> +</body></html>
new file mode 100644 --- /dev/null +++ b/layout/reftests/bidi/unicode-bidi-plaintext-textarea-4.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html><head> +<title>unicode-bidi:plaintext</title> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<style> + .plaintext { + unicode-bidi:-webkit-plaintext; + unicode-bidi:-moz-plaintext; + unicode-bidi:plaintext; + } +</style> +</head><body> +<div> +The exclamation mark should be on the left side of the first line +and on the right side of the second line. +</div> +<textarea rows=4 cols=50 dir="rtl" class="plaintext"> +שלום! +hello! +</textarea> +</body></html>
new file mode 100644 --- /dev/null +++ b/layout/reftests/bidi/unicode-bidi-plaintext-textarea-ref.html @@ -0,0 +1,16 @@ +<!DOCTYPE html> +<html> +<head> +<title>unicode-bidi:plaintext</title> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +</head> +<body> +<div> +The exclamation mark should be on the left side of the first line +and on the right side of the second line. +</div> +<textarea rows=4 cols=50 dir=ltr> +‫שלום!‬ +‪hello!‬ +</textarea> +</body></html>
new file mode 100644 --- /dev/null +++ b/layout/reftests/bidi/unicode-bidi-plaintext.html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +</head> +<body> +<div style="unicode-bidi: -webkit-plaintext; unicode-bidi: -moz-plaintext; unicode-bidi: plaintext;"> +!hello. +<br> +!שלום. +<br> +hello, לוי! +<br> +שלום, WebKit! +</div> +<pre dir="auto"> +a +( +שלום, WebKit! +hello, לוי! +) +</pre> +</body> +</html>
--- a/layout/style/test/Makefile.in +++ b/layout/style/test/Makefile.in @@ -136,16 +136,17 @@ GARBAGE += css_properties.js test_bug716226.html \ test_cascade.html \ test_ch_ex_no_infloops.html \ test_compute_data_with_start_struct.html \ test_computed_style.html \ test_computed_style_no_pseudo.html \ test_css_cross_domain.html \ test_css_eof_handling.html \ + test_default_bidi_css.html \ test_descriptor_storage.html \ test_descriptor_syntax_errors.html \ test_dont_use_document_colors.html \ test_font_face_parser.html \ test_garbage_at_end_of_declarations.html \ test_html_attribute_computed_values.html \ test_ident_escaping.html \ test_inherit_computation.html \
new file mode 100644 --- /dev/null +++ b/layout/style/test/test_default_bidi_css.html @@ -0,0 +1,79 @@ +<!DOCTYPE HTML> +<html> +<head> + <meta charset="utf-8"> + <title>Test for Bug </title> + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> +</head> +<body> +<p id="display"></p> +<div id="content" style="display: none"> + +</div> +<pre id="test"> +<script type="application/javascript"> + +/** Test for default bidi css **/ +function styleOf(name, attributes) { + var element = document.createElement(name); + for (var name in attributes) { + var value = attributes[name]; + element.setAttribute(name, value); + } + return getComputedStyle(element); +} + +var tests = [ + ['div', {}, 'ltr', '-moz-isolate'], + ['div', {'dir': 'ltr'}, 'ltr', 'embed'], + ['div', {'dir': 'rtl'}, 'rtl', 'embed'], + ['div', {'dir': 'auto'}, 'ltr', '-moz-isolate'], + ['div', {'dir': ''}, 'ltr', 'embed'], + + ['span', {}, 'ltr', 'normal'], + ['span', {'dir': 'ltr'}, 'ltr', 'embed'], + ['span', {'dir': 'rtl'}, 'rtl', 'embed'], + ['span', {'dir': 'auto'}, 'ltr', '-moz-isolate'], + ['span', {'dir': ''}, 'ltr', 'embed'], + + ['bdi', {}, 'ltr', '-moz-isolate'], + ['bdi', {'dir': 'ltr'}, 'ltr', '-moz-isolate'], + ['bdi', {'dir': 'rtl'}, 'rtl', '-moz-isolate'], + ['bdi', {'dir': 'auto'}, 'ltr', '-moz-isolate'], + ['bdi', {'dir': ''}, 'ltr', '-moz-isolate'], + + ['output', {}, 'ltr', '-moz-isolate'], + ['output', {'dir': 'ltr'}, 'ltr', '-moz-isolate'], + ['output', {'dir': 'rtl'}, 'rtl', '-moz-isolate'], + ['output', {'dir': 'auto'}, 'ltr', '-moz-isolate'], + ['output', {'dir': ''}, 'ltr', '-moz-isolate'], + + ['bdo', {}, 'ltr', 'bidi-override'], + ['bdo', {'dir': 'ltr'}, 'ltr', 'bidi-override'], + ['bdo', {'dir': 'rtl'}, 'rtl', 'bidi-override'], + ['bdo', {'dir': 'auto'}, 'ltr', '-moz-isolate bidi-override'], + ['bdo', {'dir': ''}, 'ltr', 'bidi-override'], + + ['textarea', {}, 'ltr', 'normal'], + ['textarea', {'dir': 'ltr'}, 'ltr', 'embed'], + ['textarea', {'dir': 'rtl'}, 'rtl', 'embed'], + ['textarea', {'dir': 'auto'}, 'ltr', '-moz-plaintext'], + ['textarea', {'dir': ''}, 'ltr', 'embed'], + + ['pre', {}, 'ltr', 'normal'], + ['pre', {'dir': 'ltr'}, 'ltr', 'embed'], + ['pre', {'dir': 'rtl'}, 'rtl', 'embed'], + ['pre', {'dir': 'auto'}, 'ltr', '-moz-plaintext'], + ['pre', {'dir': ''}, 'ltr', 'embed'], +].forEach(function (test) { + var style = styleOf(test[0], test[1]); + is(style.direction, test[2], "default value for direction"); + is(style.unicodeBidi, test[3], "default value for unicode-bidi"); +}); + + +</script> +</pre> +</body> +</html>