Skip to content

Commit

Permalink
Bug 28420 - Implement HTML5 <ruby> rendering
Browse files Browse the repository at this point in the history
(https://bugs.webkit.org/show_bug.cgi?id=28420)

Reviewed by Dave Hyatt.

First rudimentary implementation of HTML5 ruby rendering support - layout tests.

New layout tests: basic rendering:
* fast/ruby/ruby-empty-rt.html: Added.
* fast/ruby/ruby-length.html: Added.
* fast/ruby/ruby-run-break.html: Added.
* fast/ruby/ruby-runs-spans.html: Added.
* fast/ruby/ruby-runs.html: Added.
* fast/ruby/ruby-simple-rp.html: Added.
* fast/ruby/ruby-simple.html: Added.
* fast/ruby/ruby-trailing.html: Added.

New layout tests: DOM manipulation within <ruby>
* fast/ruby/rubyDOM-insert-rt.html: Added.
* fast/ruby/rubyDOM-insert-text1.html: Added.
* fast/ruby/rubyDOM-insert-text2.html: Added.
* fast/ruby/rubyDOM-insert-text3.html: Added.
* fast/ruby/rubyDOM-remove-rt1.html: Added.
* fast/ruby/rubyDOM-remove-rt2.html: Added.
* fast/ruby/rubyDOM-remove-text1.html: Added.
* fast/ruby/rubyDOM-remove-text2.html: Added.

New layout tests results:
* platform/mac/fast/ruby: Added.
* platform/mac/fast/ruby/ruby-empty-rt-expected.checksum: Added.
* platform/mac/fast/ruby/ruby-empty-rt-expected.png: Added.
* platform/mac/fast/ruby/ruby-empty-rt-expected.txt: Added.
* platform/mac/fast/ruby/ruby-length-expected.checksum: Added.
* platform/mac/fast/ruby/ruby-length-expected.png: Added.
* platform/mac/fast/ruby/ruby-length-expected.txt: Added.
* platform/mac/fast/ruby/ruby-run-break-expected.checksum: Added.
* platform/mac/fast/ruby/ruby-run-break-expected.png: Added.
* platform/mac/fast/ruby/ruby-run-break-expected.txt: Added.
* platform/mac/fast/ruby/ruby-runs-expected.checksum: Added.
* platform/mac/fast/ruby/ruby-runs-expected.png: Added.
* platform/mac/fast/ruby/ruby-runs-expected.txt: Added.
* platform/mac/fast/ruby/ruby-runs-spans-expected.checksum: Added.
* platform/mac/fast/ruby/ruby-runs-spans-expected.png: Added.
* platform/mac/fast/ruby/ruby-runs-spans-expected.txt: Added.
* platform/mac/fast/ruby/ruby-simple-expected.checksum: Added.
* platform/mac/fast/ruby/ruby-simple-expected.png: Added.
* platform/mac/fast/ruby/ruby-simple-expected.txt: Added.
* platform/mac/fast/ruby/ruby-simple-rp-expected.checksum: Added.
* platform/mac/fast/ruby/ruby-simple-rp-expected.png: Added.
* platform/mac/fast/ruby/ruby-simple-rp-expected.txt: Added.
* platform/mac/fast/ruby/ruby-trailing-expected.checksum: Added.
* platform/mac/fast/ruby/ruby-trailing-expected.png: Added.
* platform/mac/fast/ruby/ruby-trailing-expected.txt: Added.
* platform/mac/fast/ruby/rubyDOM-insert-rt-expected.checksum: Added.
* platform/mac/fast/ruby/rubyDOM-insert-rt-expected.png: Added.
* platform/mac/fast/ruby/rubyDOM-insert-rt-expected.txt: Added.
* platform/mac/fast/ruby/rubyDOM-insert-text1-expected.checksum: Added.
* platform/mac/fast/ruby/rubyDOM-insert-text1-expected.png: Added.
* platform/mac/fast/ruby/rubyDOM-insert-text1-expected.txt: Added.
* platform/mac/fast/ruby/rubyDOM-insert-text2-expected.checksum: Added.
* platform/mac/fast/ruby/rubyDOM-insert-text2-expected.png: Added.
* platform/mac/fast/ruby/rubyDOM-insert-text2-expected.txt: Added.
* platform/mac/fast/ruby/rubyDOM-insert-text3-expected.checksum: Added.
* platform/mac/fast/ruby/rubyDOM-insert-text3-expected.png: Added.
* platform/mac/fast/ruby/rubyDOM-insert-text3-expected.txt: Added.
* platform/mac/fast/ruby/rubyDOM-remove-rt1-expected.checksum: Added.
* platform/mac/fast/ruby/rubyDOM-remove-rt1-expected.png: Added.
* platform/mac/fast/ruby/rubyDOM-remove-rt1-expected.txt: Added.
* platform/mac/fast/ruby/rubyDOM-remove-rt2-expected.checksum: Added.
* platform/mac/fast/ruby/rubyDOM-remove-rt2-expected.png: Added.
* platform/mac/fast/ruby/rubyDOM-remove-rt2-expected.txt: Added.
* platform/mac/fast/ruby/rubyDOM-remove-text1-expected.checksum: Added.
* platform/mac/fast/ruby/rubyDOM-remove-text1-expected.png: Added.
* platform/mac/fast/ruby/rubyDOM-remove-text1-expected.txt: Added.
* platform/mac/fast/ruby/rubyDOM-remove-text2-expected.checksum: Added.
* platform/mac/fast/ruby/rubyDOM-remove-text2-expected.png: Added.
* platform/mac/fast/ruby/rubyDOM-remove-text2-expected.txt: Added.



Canonical link: https://commits.webkit.org/41925@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@50495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Roland Steiner committed Nov 4, 2009
1 parent 07d9a76 commit d3e9fa0
Show file tree
Hide file tree
Showing 65 changed files with 1,028 additions and 0 deletions.
80 changes: 80 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,83 @@
2009-11-04 Roland Steiner <rolandsteiner@chromium.org>

Reviewed by Dave Hyatt.

Bug 28420 - Implement HTML5 <ruby> rendering
(https://bugs.webkit.org/show_bug.cgi?id=28420)

First rudimentary implementation of HTML5 ruby rendering support - layout tests.

New layout tests: basic rendering:
* fast/ruby/ruby-empty-rt.html: Added.
* fast/ruby/ruby-length.html: Added.
* fast/ruby/ruby-run-break.html: Added.
* fast/ruby/ruby-runs-spans.html: Added.
* fast/ruby/ruby-runs.html: Added.
* fast/ruby/ruby-simple-rp.html: Added.
* fast/ruby/ruby-simple.html: Added.
* fast/ruby/ruby-trailing.html: Added.

New layout tests: DOM manipulation within <ruby>
* fast/ruby/rubyDOM-insert-rt.html: Added.
* fast/ruby/rubyDOM-insert-text1.html: Added.
* fast/ruby/rubyDOM-insert-text2.html: Added.
* fast/ruby/rubyDOM-insert-text3.html: Added.
* fast/ruby/rubyDOM-remove-rt1.html: Added.
* fast/ruby/rubyDOM-remove-rt2.html: Added.
* fast/ruby/rubyDOM-remove-text1.html: Added.
* fast/ruby/rubyDOM-remove-text2.html: Added.

New layout tests results:
* platform/mac/fast/ruby: Added.
* platform/mac/fast/ruby/ruby-empty-rt-expected.checksum: Added.
* platform/mac/fast/ruby/ruby-empty-rt-expected.png: Added.
* platform/mac/fast/ruby/ruby-empty-rt-expected.txt: Added.
* platform/mac/fast/ruby/ruby-length-expected.checksum: Added.
* platform/mac/fast/ruby/ruby-length-expected.png: Added.
* platform/mac/fast/ruby/ruby-length-expected.txt: Added.
* platform/mac/fast/ruby/ruby-run-break-expected.checksum: Added.
* platform/mac/fast/ruby/ruby-run-break-expected.png: Added.
* platform/mac/fast/ruby/ruby-run-break-expected.txt: Added.
* platform/mac/fast/ruby/ruby-runs-expected.checksum: Added.
* platform/mac/fast/ruby/ruby-runs-expected.png: Added.
* platform/mac/fast/ruby/ruby-runs-expected.txt: Added.
* platform/mac/fast/ruby/ruby-runs-spans-expected.checksum: Added.
* platform/mac/fast/ruby/ruby-runs-spans-expected.png: Added.
* platform/mac/fast/ruby/ruby-runs-spans-expected.txt: Added.
* platform/mac/fast/ruby/ruby-simple-expected.checksum: Added.
* platform/mac/fast/ruby/ruby-simple-expected.png: Added.
* platform/mac/fast/ruby/ruby-simple-expected.txt: Added.
* platform/mac/fast/ruby/ruby-simple-rp-expected.checksum: Added.
* platform/mac/fast/ruby/ruby-simple-rp-expected.png: Added.
* platform/mac/fast/ruby/ruby-simple-rp-expected.txt: Added.
* platform/mac/fast/ruby/ruby-trailing-expected.checksum: Added.
* platform/mac/fast/ruby/ruby-trailing-expected.png: Added.
* platform/mac/fast/ruby/ruby-trailing-expected.txt: Added.
* platform/mac/fast/ruby/rubyDOM-insert-rt-expected.checksum: Added.
* platform/mac/fast/ruby/rubyDOM-insert-rt-expected.png: Added.
* platform/mac/fast/ruby/rubyDOM-insert-rt-expected.txt: Added.
* platform/mac/fast/ruby/rubyDOM-insert-text1-expected.checksum: Added.
* platform/mac/fast/ruby/rubyDOM-insert-text1-expected.png: Added.
* platform/mac/fast/ruby/rubyDOM-insert-text1-expected.txt: Added.
* platform/mac/fast/ruby/rubyDOM-insert-text2-expected.checksum: Added.
* platform/mac/fast/ruby/rubyDOM-insert-text2-expected.png: Added.
* platform/mac/fast/ruby/rubyDOM-insert-text2-expected.txt: Added.
* platform/mac/fast/ruby/rubyDOM-insert-text3-expected.checksum: Added.
* platform/mac/fast/ruby/rubyDOM-insert-text3-expected.png: Added.
* platform/mac/fast/ruby/rubyDOM-insert-text3-expected.txt: Added.
* platform/mac/fast/ruby/rubyDOM-remove-rt1-expected.checksum: Added.
* platform/mac/fast/ruby/rubyDOM-remove-rt1-expected.png: Added.
* platform/mac/fast/ruby/rubyDOM-remove-rt1-expected.txt: Added.
* platform/mac/fast/ruby/rubyDOM-remove-rt2-expected.checksum: Added.
* platform/mac/fast/ruby/rubyDOM-remove-rt2-expected.png: Added.
* platform/mac/fast/ruby/rubyDOM-remove-rt2-expected.txt: Added.
* platform/mac/fast/ruby/rubyDOM-remove-text1-expected.checksum: Added.
* platform/mac/fast/ruby/rubyDOM-remove-text1-expected.png: Added.
* platform/mac/fast/ruby/rubyDOM-remove-text1-expected.txt: Added.
* platform/mac/fast/ruby/rubyDOM-remove-text2-expected.checksum: Added.
* platform/mac/fast/ruby/rubyDOM-remove-text2-expected.png: Added.
* platform/mac/fast/ruby/rubyDOM-remove-text2-expected.txt: Added.

2009-11-03 Kenneth Russell <kbr@google.com>

Reviewed by Oliver Hunt.
Expand Down
11 changes: 11 additions & 0 deletions LayoutTests/fast/ruby/ruby-empty-rt.html
@@ -0,0 +1,11 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>The following is a test for having a &lt;rt&gt; immediately following another.</p>
<br>
<br>
<p>準太郎は<ruby>東京<rt>とうきょう</rt>工業大学<rt>こうぎょう</rt><rt>だいがく</rt></ruby>から卒業しました。
</body>
</html>
12 changes: 12 additions & 0 deletions LayoutTests/fast/ruby/ruby-length.html
@@ -0,0 +1,12 @@
<head>
<style>
</style>
</head>
<body>
This is a initial test for simple ruby.
There should be 2 ruby annotations on below line, one with a ruby text shorter than the base,
and one with a ruby text longer than the base.
<br>
<br>
CSS3/HTML5のルビは<ruby>日本語<rt>Japanese Langauge</rt></ruby>によく<ruby>使われて<rt>used</rt></ruby>います。
</body>
12 changes: 12 additions & 0 deletions LayoutTests/fast/ruby/ruby-run-break.html
@@ -0,0 +1,12 @@
<head>
</head>
<body>
This is a test for multiple ruby runs and line breaks.
There is a div with a blue border and 10px padding. This contains a single &lt;ruby&gt; markup in the text contained in the block, broken across 2 lines.
Part of it should be on the first line, the rest on the other line.
<br>
<br>
<div style="border: 2px solid blue; padding: 10px; width:260px;">
CSS3/HTML5のルビは<ruby><rt></rt><rt>ほん</rt><rt></rt></ruby>によく使われています。
</div>
</body>
9 changes: 9 additions & 0 deletions LayoutTests/fast/ruby/ruby-runs-spans.html
@@ -0,0 +1,9 @@
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<p>The following is a test for having non-text inline elements as base in a &lt;ruby&gt;.</p>
<p>準太郎は<ruby><span id="T">東京</span><rt>とうきょう</rt><span id="K">工業</span><span id="D">大学</span><rt>こうぎょうだいがく</rt></ruby>から卒業しました。
</body>
</html>
10 changes: 10 additions & 0 deletions LayoutTests/fast/ruby/ruby-runs.html
@@ -0,0 +1,10 @@
<head>
<style>
</style>
</head>
<body>
This is a test for multiple ruby runs.
<br>
<br>
CSS3/HTML5のルビは<ruby><rt></rt><rt>ほん</rt><rt></rt></ruby>によく使われています。
</body>
11 changes: 11 additions & 0 deletions LayoutTests/fast/ruby/ruby-simple-rp.html
@@ -0,0 +1,11 @@
<head>
<style>
</style>
</head>
<body>
This is a test for simple ruby that contains &lt;rp&gt; tags.
Contents of the &lt;rp&gt; tags (opening and closing brackets) should not show when ruby is suppoorted.
<br>
<br>
CSS3/HTML5のルビは<ruby>日本語<rp></rp><rt>にほんご</rt><rp></rp></ruby>によく使われています。
</body>
10 changes: 10 additions & 0 deletions LayoutTests/fast/ruby/ruby-simple.html
@@ -0,0 +1,10 @@
<head>
<style>
</style>
</head>
<body>
This is a initial test for simple ruby.
<br>
<br>
CSS3/HTML5のルビは<ruby>日本語<rt>にほんご</rt></ruby>によく使われています。
</body>
11 changes: 11 additions & 0 deletions LayoutTests/fast/ruby/ruby-trailing.html
@@ -0,0 +1,11 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>The following is a test for having a trailing base within a &lt;ruby&gt; with no associated ruby text.</p>
<br>
<br>
<p>準太郎は<ruby>東京<rt>とうきょう</rt>工業<rt>こうぎょう</rt>大学</ruby>から卒業しました。
</body>
</html>
24 changes: 24 additions & 0 deletions LayoutTests/fast/ruby/rubyDOM-insert-rt.html
@@ -0,0 +1,24 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script>
function test()
{
var ruby = document.getElementById('R');
var span = document.getElementById('D');
var newRT = document.createElement('rt');
var newRTText = document.createTextNode('こうぎょう');
newRT.appendChild(newRTText);
ruby.insertBefore(newRT, span);
}
</script>
</head>
<body onload="test()">
<p>The following is a test for DOM manipulation within &lt;ruby&gt;: Inserting a new &lt;rt&gt; element</p>
<p>Both lines should look identical (the first line is the one manipulated).</p>
<br>
<br>
<p>準太郎は<ruby id="R"><span id="T">東京</span><rt>とうきょう</rt><span id="K">工業</span><span id="D">大学</span><rt>だいがく</rt></ruby>から卒業しました。</p>
<p>準太郎は<ruby><span>東京</span><rt>とうきょう</rt><span>工業</span><rt>こうぎょう</rt><span>大学</span><rt>だいがく</rt></ruby>から卒業しました。</p>
</body>
</html>
22 changes: 22 additions & 0 deletions LayoutTests/fast/ruby/rubyDOM-insert-text1.html
@@ -0,0 +1,22 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script>
function test()
{
var ruby = document.getElementById('r');
var rt = document.getElementById('rt');
var newText = document.createTextNode('工業');
ruby.insertBefore(newText, rt);
}
</script>
</head>
<body onload="test()">
<p>The following is a test for DOM manipulation within &lt;ruby&gt;: Inserting a new text before a &lt;rt&gt; element</p>
<p>Both lines should look identical (the first line is the one manipulated).</p>
<br>
<br>
<p>準太郎は<ruby id="r"><span>東京</span><rt>とうきょう</rt><rt id="rt">こうぎょう</rt><span>大学</span><rt>だいがく</rt></ruby>から卒業しました。</p>
<p>準太郎は<ruby><span>東京</span><rt>とうきょう</rt>工業<rt>こうぎょう</rt><span>大学</span><rt>だいがく</rt></ruby>から卒業しました。</p>
</body>
</html>
22 changes: 22 additions & 0 deletions LayoutTests/fast/ruby/rubyDOM-insert-text2.html
@@ -0,0 +1,22 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script>
function test()
{
var ruby = document.getElementById('r');
var rt = document.getElementById('rt');
var newText = document.createTextNode('大学');
ruby.insertBefore(newText, rt);
}
</script>
</head>
<body onload="test()">
<p>The following is a test for DOM manipulation within &lt;ruby&gt;: Inserting a new text before a &lt;rt&gt; element that already contains text.</p>
<p>Both lines should look identical (the first line is the one manipulated).</p>
<br>
<br>
<p>準太郎は<ruby id="r"><span>工業</span><rt id="rt">こうぎょうだいがく</rt></ruby>から卒業しました。</p>
<p>準太郎は<ruby><span>工業</span>大学<rt>こうぎょうだいがく</rt></ruby>から卒業しました。</p>
</body>
</html>
22 changes: 22 additions & 0 deletions LayoutTests/fast/ruby/rubyDOM-insert-text3.html
@@ -0,0 +1,22 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script>
function test()
{
var ruby = document.getElementById('r');
var text = document.getElementById('t');
var newText = document.createTextNode('工業');
ruby.insertBefore(newText, t);
}
</script>
</head>
<body onload="test()">
<p>The following is a test for DOM manipulation within &lt;ruby&gt;: Inserting a new text before another text of a ruby base.</p>
<p>Both lines should look identical (the first line is the one manipulated).</p>
<br>
<br>
<p>準太郎は<ruby id="r"><span id="t">大学</span><rt>こうぎょうだいがく</rt></ruby>から卒業しました。</p>
<p>準太郎は<ruby>工業<span>大学</span><rt>こうぎょうだいがく</rt></ruby>から卒業しました。</p>
</body>
</html>
21 changes: 21 additions & 0 deletions LayoutTests/fast/ruby/rubyDOM-remove-rt1.html
@@ -0,0 +1,21 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script>
function test()
{
var ruby = document.getElementById('r');
var k = document.getElementById('rt');
ruby.removeChild(rt);
}
</script>
</head>
<body onload="test()">
<p>The following is a test for DOM manipulation within &lt;ruby&gt;: Removing the last &lt;rt&gt;, leaving the base without ruby text.</p>
<p>Both lines should look identical (the first line is the one manipulated).</p>
<br>
<br>
<p>準太郎は<ruby id="r">工業<rt>こうぎょう</rt>大学<rt id="rt">Shouldn't show</rt></ruby>から卒業しました。</p>
<p>準太郎は<ruby>工業<rt>こうぎょう</rt>大学</ruby>から卒業しました。</p>
</body>
</html>
21 changes: 21 additions & 0 deletions LayoutTests/fast/ruby/rubyDOM-remove-rt2.html
@@ -0,0 +1,21 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script>
function test()
{
var ruby = document.getElementById('r');
var k = document.getElementById('rt');
ruby.removeChild(rt);
}
</script>
</head>
<body onload="test()">
<p>The following is a test for DOM manipulation within &lt;ruby&gt;: Removing the last &lt;rt&gt;, forcing a merge with the right neighbour run</p>
<p>Both lines should look identical (the first line is the one manipulated).</p>
<br>
<br>
<p>準太郎は<ruby id="r">工業<rt id="rt">Shouldn't show</rt>大学<rt>こうぎょうだいがく</rt></ruby>から卒業しました。</p>
<p>準太郎は<ruby>工業大学<rt>こうぎょうだいがく</rt></ruby>から卒業しました。</p>
</body>
</html>
21 changes: 21 additions & 0 deletions LayoutTests/fast/ruby/rubyDOM-remove-text1.html
@@ -0,0 +1,21 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script>
function test()
{
var ruby = document.getElementById('r');
var k = document.getElementById('k');
ruby.removeChild(k);
}
</script>
</head>
<body onload="test()">
<p>The following is a test for DOM manipulation within &lt;ruby&gt;: Removing a ruby base object, leaving the base non-empty.</p>
<p>Both lines should look identical (the first line is the one manipulated).</p>
<br>
<br>
<p>準太郎は<ruby id="r"><span id="k">工業</span><span>大学</span><rt>だいがく</rt></ruby>から卒業しました。</p>
<p>準太郎は<ruby><span>大学</span><rt>だいがく</rt></ruby>から卒業しました。</p>
</body>
</html>
21 changes: 21 additions & 0 deletions LayoutTests/fast/ruby/rubyDOM-remove-text2.html
@@ -0,0 +1,21 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script>
function test()
{
var ruby = document.getElementById('r');
var k = document.getElementById('k');
ruby.removeChild(k);
}
</script>
</head>
<body onload="test()">
<p>The following is a test for DOM manipulation within &lt;ruby&gt;: Removing a ruby base object, leaving the base empty.</p>
<p>Both lines should look identical (the first line is the one manipulated).</p>
<br>
<br>
<p>準太郎は<ruby id="r"><span id="k">工業</span><rt>だいがく</rt></ruby>から卒業しました。</p>
<p>準太郎は<ruby><rt>だいがく</rt></ruby>から卒業しました。</p>
</body>
</html>
@@ -0,0 +1 @@
a492ba3222a57c03f379905ccc3412a3
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d3e9fa0

Please sign in to comment.