Bug 1224013 part 3 - Add reftests for text-emphasis with ruby. r=jfkthame
authorXidorn Quan <quanxunzhen@gmail.com>
Fri, 04 Dec 2015 15:16:54 +1100
changeset 275593 3714873643124a5c65c938366db4eba3fc9cbcb4
parent 275592 5f5ca882d872a71622cc305bc25a31fb5fc7ca79
child 275594 ce4623289f7f7fa28c7d005b61ba931190828f5b
push id68886
push userxquan@mozilla.com
push dateFri, 04 Dec 2015 04:17:51 +0000
treeherdermozilla-inbound@371487364312 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame
bugs1224013
milestone45.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
Bug 1224013 part 3 - Add reftests for text-emphasis with ruby. r=jfkthame
layout/reftests/w3c-css/submitted/text-decor-3/reftest.list
layout/reftests/w3c-css/submitted/text-decor-3/support/generate-text-emphasis-ruby-tests.py
layout/reftests/w3c-css/submitted/text-decor-3/text-emphasis-ruby-001-ref.html
layout/reftests/w3c-css/submitted/text-decor-3/text-emphasis-ruby-001.html
layout/reftests/w3c-css/submitted/text-decor-3/text-emphasis-ruby-002-ref.html
layout/reftests/w3c-css/submitted/text-decor-3/text-emphasis-ruby-002.html
layout/reftests/w3c-css/submitted/text-decor-3/text-emphasis-ruby-003-ref.html
layout/reftests/w3c-css/submitted/text-decor-3/text-emphasis-ruby-003.html
layout/reftests/w3c-css/submitted/text-decor-3/text-emphasis-ruby-003a.html
layout/reftests/w3c-css/submitted/text-decor-3/text-emphasis-ruby-004-ref.html
layout/reftests/w3c-css/submitted/text-decor-3/text-emphasis-ruby-004.html
layout/reftests/w3c-css/submitted/text-decor-3/text-emphasis-ruby-004a.html
--- a/layout/reftests/w3c-css/submitted/text-decor-3/reftest.list
+++ b/layout/reftests/w3c-css/submitted/text-decor-3/reftest.list
@@ -101,8 +101,17 @@ skip-if(/^Windows\x20NT\x205\.1/.test(ht
 == text-emphasis-position-property-006a.html text-emphasis-position-property-006-ref.html
 == text-emphasis-position-property-006b.html text-emphasis-position-property-006-ref.html
 == text-emphasis-position-property-006c.html text-emphasis-position-property-006-ref.html
 == text-emphasis-position-property-006d.html text-emphasis-position-property-006-ref.html
 == text-emphasis-position-property-006e.html text-emphasis-position-property-006-ref.html
 == text-emphasis-position-property-006f.html text-emphasis-position-property-006-ref.html
 == text-emphasis-position-property-006g.html text-emphasis-position-property-006-ref.html
 # END tests from support/generate-text-emphasis-position-property-tests.py
+
+# START tests from support/generate-text-emphasis-ruby-tests.py
+== text-emphasis-ruby-001.html text-emphasis-ruby-001-ref.html
+== text-emphasis-ruby-002.html text-emphasis-ruby-002-ref.html
+== text-emphasis-ruby-003.html text-emphasis-ruby-003-ref.html
+== text-emphasis-ruby-003a.html text-emphasis-ruby-003-ref.html
+== text-emphasis-ruby-004.html text-emphasis-ruby-004-ref.html
+== text-emphasis-ruby-004a.html text-emphasis-ruby-004-ref.html
+# END tests from support/generate-text-emphasis-ruby-tests.py
new file mode 100644
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/text-decor-3/support/generate-text-emphasis-ruby-tests.py
@@ -0,0 +1,69 @@
+#!/usr/bin/env python
+# - * - coding: UTF-8 - * -
+
+"""
+This script generates tests text-emphasis-ruby-001 ~ 004 which tests
+emphasis marks with ruby in four directions. It outputs a list of all
+tests it generated in the format of Mozilla reftest.list to the stdout.
+"""
+
+from __future__ import unicode_literals
+
+TEST_FILE = 'text-emphasis-ruby-{:03}{}.html'
+TEST_TEMPLATE = '''<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Test: text-emphasis and ruby, {wm}, {pos}</title>
+<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<link rel="help" href="https://drafts.csswg.org/css-text-decor-3/#text-emphasis-position-property">
+<meta name="assert" content="emphasis marks are drawn outside the ruby">
+<link rel="match" href="reference/text-emphasis-ruby-{index:03}-ref.html">
+<p>Pass if the emphasis marks are outside the ruby:</p>
+<div style="line-height: 5; writing-mode: {wm}; ruby-position: {ruby_pos}; text-emphasis-position: {posval}">ルビ<span style="text-emphasis: circle">と<ruby>圏<rt>けん</rt>点<rt>てん</rt></ruby>を</span>同時</div>
+'''
+
+REF_FILE = 'text-emphasis-ruby-{:03}-ref.html'
+REF_TEMPLATE = '''<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Reference: text-emphasis and ruby, {wm}, {pos}</title>
+<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<style> rtc {{ font-variant-east-asian: inherit; }} </style>
+<p>Pass if the emphasis marks are outside the ruby:</p>
+<div style="line-height: 5; writing-mode: {wm}; ruby-position: {posval}">ルビ<ruby>と<rtc>&#x25CF;</rtc>圏<rt>けん</rt><rtc>&#x25CF;</rtc>点<rt>てん</rt><rtc>&#x25CF;</rtc>を<rtc>&#x25CF;</rtc></ruby>同時</div>
+'''
+
+TEST_CASES = [
+        ('top', 'horizontal-tb', 'over', [
+            ('horizontal-tb', 'over right')]),
+        ('bottom', 'horizontal-tb', 'under', [
+            ('horizontal-tb', 'under right')]),
+        ('right', 'vertical-rl', 'over', [
+            ('vertical-rl', 'over right'),
+            ('vertical-lr', 'over right')]),
+        ('left', 'vertical-rl', 'under', [
+            ('vertical-rl', 'over left'),
+            ('vertical-lr', 'over left')]),
+    ]
+
+SUFFIXES = ['', 'a']
+
+def write_file(filename, content):
+    with open(filename, 'wb') as f:
+        f.write(content.encode('UTF-8'))
+
+print("# START tests from {}".format(__file__))
+idx = 0
+for pos, ref_wm, ruby_pos, subtests in TEST_CASES:
+    idx += 1
+    ref_file = REF_FILE.format(idx)
+    ref_content = REF_TEMPLATE.format(pos=pos, wm=ref_wm, posval=ruby_pos)
+    write_file(ref_file, ref_content)
+    suffix = iter(SUFFIXES)
+    for wm, posval in subtests:
+        test_file = TEST_FILE.format(idx, next(suffix))
+        test_content = TEST_TEMPLATE.format(
+            wm=wm, pos=pos, index=idx, ruby_pos=ruby_pos, posval=posval)
+        write_file(test_file, test_content)
+        print("== {} {}".format(test_file, ref_file))
+print("# END tests from {}".format(__file__))
new file mode 100644
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/text-decor-3/text-emphasis-ruby-001-ref.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Reference: text-emphasis and ruby, horizontal-tb, top</title>
+<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<style> rtc { font-variant-east-asian: inherit; } </style>
+<p>Pass if the emphasis marks are outside the ruby:</p>
+<div style="line-height: 5; writing-mode: horizontal-tb; ruby-position: over">ルビ<ruby>と<rtc>&#x25CF;</rtc>圏<rt>けん</rt><rtc>&#x25CF;</rtc>点<rt>てん</rt><rtc>&#x25CF;</rtc>を<rtc>&#x25CF;</rtc></ruby>同時</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/text-decor-3/text-emphasis-ruby-001.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Test: text-emphasis and ruby, horizontal-tb, top</title>
+<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<link rel="help" href="https://drafts.csswg.org/css-text-decor-3/#text-emphasis-position-property">
+<meta name="assert" content="emphasis marks are drawn outside the ruby">
+<link rel="match" href="reference/text-emphasis-ruby-001-ref.html">
+<p>Pass if the emphasis marks are outside the ruby:</p>
+<div style="line-height: 5; writing-mode: horizontal-tb; ruby-position: over; text-emphasis-position: over right">ルビ<span style="text-emphasis: circle">と<ruby>圏<rt>けん</rt>点<rt>てん</rt></ruby>を</span>同時</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/text-decor-3/text-emphasis-ruby-002-ref.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Reference: text-emphasis and ruby, horizontal-tb, bottom</title>
+<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<style> rtc { font-variant-east-asian: inherit; } </style>
+<p>Pass if the emphasis marks are outside the ruby:</p>
+<div style="line-height: 5; writing-mode: horizontal-tb; ruby-position: under">ルビ<ruby>と<rtc>&#x25CF;</rtc>圏<rt>けん</rt><rtc>&#x25CF;</rtc>点<rt>てん</rt><rtc>&#x25CF;</rtc>を<rtc>&#x25CF;</rtc></ruby>同時</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/text-decor-3/text-emphasis-ruby-002.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Test: text-emphasis and ruby, horizontal-tb, bottom</title>
+<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<link rel="help" href="https://drafts.csswg.org/css-text-decor-3/#text-emphasis-position-property">
+<meta name="assert" content="emphasis marks are drawn outside the ruby">
+<link rel="match" href="reference/text-emphasis-ruby-002-ref.html">
+<p>Pass if the emphasis marks are outside the ruby:</p>
+<div style="line-height: 5; writing-mode: horizontal-tb; ruby-position: under; text-emphasis-position: under right">ルビ<span style="text-emphasis: circle">と<ruby>圏<rt>けん</rt>点<rt>てん</rt></ruby>を</span>同時</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/text-decor-3/text-emphasis-ruby-003-ref.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Reference: text-emphasis and ruby, vertical-rl, right</title>
+<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<style> rtc { font-variant-east-asian: inherit; } </style>
+<p>Pass if the emphasis marks are outside the ruby:</p>
+<div style="line-height: 5; writing-mode: vertical-rl; ruby-position: over">ルビ<ruby>と<rtc>&#x25CF;</rtc>圏<rt>けん</rt><rtc>&#x25CF;</rtc>点<rt>てん</rt><rtc>&#x25CF;</rtc>を<rtc>&#x25CF;</rtc></ruby>同時</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/text-decor-3/text-emphasis-ruby-003.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Test: text-emphasis and ruby, vertical-rl, right</title>
+<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<link rel="help" href="https://drafts.csswg.org/css-text-decor-3/#text-emphasis-position-property">
+<meta name="assert" content="emphasis marks are drawn outside the ruby">
+<link rel="match" href="reference/text-emphasis-ruby-003-ref.html">
+<p>Pass if the emphasis marks are outside the ruby:</p>
+<div style="line-height: 5; writing-mode: vertical-rl; ruby-position: over; text-emphasis-position: over right">ルビ<span style="text-emphasis: circle">と<ruby>圏<rt>けん</rt>点<rt>てん</rt></ruby>を</span>同時</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/text-decor-3/text-emphasis-ruby-003a.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Test: text-emphasis and ruby, vertical-lr, right</title>
+<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<link rel="help" href="https://drafts.csswg.org/css-text-decor-3/#text-emphasis-position-property">
+<meta name="assert" content="emphasis marks are drawn outside the ruby">
+<link rel="match" href="reference/text-emphasis-ruby-003-ref.html">
+<p>Pass if the emphasis marks are outside the ruby:</p>
+<div style="line-height: 5; writing-mode: vertical-lr; ruby-position: over; text-emphasis-position: over right">ルビ<span style="text-emphasis: circle">と<ruby>圏<rt>けん</rt>点<rt>てん</rt></ruby>を</span>同時</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/text-decor-3/text-emphasis-ruby-004-ref.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Reference: text-emphasis and ruby, vertical-rl, left</title>
+<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<style> rtc { font-variant-east-asian: inherit; } </style>
+<p>Pass if the emphasis marks are outside the ruby:</p>
+<div style="line-height: 5; writing-mode: vertical-rl; ruby-position: under">ルビ<ruby>と<rtc>&#x25CF;</rtc>圏<rt>けん</rt><rtc>&#x25CF;</rtc>点<rt>てん</rt><rtc>&#x25CF;</rtc>を<rtc>&#x25CF;</rtc></ruby>同時</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/text-decor-3/text-emphasis-ruby-004.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Test: text-emphasis and ruby, vertical-rl, left</title>
+<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<link rel="help" href="https://drafts.csswg.org/css-text-decor-3/#text-emphasis-position-property">
+<meta name="assert" content="emphasis marks are drawn outside the ruby">
+<link rel="match" href="reference/text-emphasis-ruby-004-ref.html">
+<p>Pass if the emphasis marks are outside the ruby:</p>
+<div style="line-height: 5; writing-mode: vertical-rl; ruby-position: under; text-emphasis-position: over left">ルビ<span style="text-emphasis: circle">と<ruby>圏<rt>けん</rt>点<rt>てん</rt></ruby>を</span>同時</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/text-decor-3/text-emphasis-ruby-004a.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Test: text-emphasis and ruby, vertical-lr, left</title>
+<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<link rel="help" href="https://drafts.csswg.org/css-text-decor-3/#text-emphasis-position-property">
+<meta name="assert" content="emphasis marks are drawn outside the ruby">
+<link rel="match" href="reference/text-emphasis-ruby-004-ref.html">
+<p>Pass if the emphasis marks are outside the ruby:</p>
+<div style="line-height: 5; writing-mode: vertical-lr; ruby-position: under; text-emphasis-position: over left">ルビ<span style="text-emphasis: circle">と<ruby>圏<rt>けん</rt>点<rt>てん</rt></ruby>を</span>同時</div>