Bug 1055658 part 3 - Add reftests for ruby annotation relative positioning. r=dbaron
--- a/layout/reftests/css-ruby/reftest.list
+++ b/layout/reftests/css-ruby/reftest.list
@@ -23,16 +23,18 @@ fuzzy-if(winWidget,35,1) == dynamic-remo
== intra-level-whitespace-1.html intra-level-whitespace-1-ref.html
== intra-level-whitespace-2.html intra-level-whitespace-2-ref.html
== intra-level-whitespace-3.html intra-level-whitespace-3-ref.html
== justification-1.html justification-1-ref.html
== justification-2.html justification-2-ref.html
== line-height-1.html line-height-1-ref.html
== line-height-2.html line-height-2-ref.html
== line-height-3.html line-height-3-ref.html
+fails-if(cocoaWidget) == relative-positioning-1.html relative-positioning-1-ref.html # bug 1120280
+== relative-positioning-2.html relative-positioning-2-ref.html
== ruby-span-1.html ruby-span-1-ref.html
== ruby-whitespace-1.html ruby-whitespace-1-ref.html
== ruby-whitespace-2.html ruby-whitespace-2-ref.html
== ruby-position-horizontal.html ruby-position-horizontal-ref.html
pref(layout.css.vertical-text.enabled,true) fails == ruby-position-vertical-lr.html ruby-position-vertical-lr-ref.html # bug 1112474
pref(layout.css.vertical-text.enabled,true) fails == ruby-position-vertical-rl.html ruby-position-vertical-rl-ref.html # bug 1112474
!= ruby-reflow-1-opaqueruby.html ruby-reflow-1-noruby.html
== ruby-reflow-1-transparentruby.html ruby-reflow-1-noruby.html
new file mode 100644
--- /dev/null
+++ b/layout/reftests/css-ruby/relative-positioning-1-ref.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <title>Bug 1055658 - Relative positioning for ruby</title>
+ <style>
+ .wrapper {
+ width: 50px;
+ text-align: center;
+ }
+ .annotation, .annotation > div {
+ position: absolute;
+ line-height: 1;
+ }
+ </style>
+</head>
+<body>
+ <div style="height: 80px; line-height: 80px;">
+ <div class="wrapper" style="display: inline-block; line-height: normal; position: relative;">
+ <div class="annotation" style="top: 0;">
+ <div class="wrapper" style="top: -100%;">a<span style="position: relative; top: -10px;">b</span>c</div>
+ <!-- to give container a nonzero size for
+ percent values to resolve against -->
+ </div>
+ base
+ </div>
+ </div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/css-ruby/relative-positioning-1.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <title>Bug 1055658 - Relative positioning for ruby</title>
+ <link rel="stylesheet" href="common.css">
+ <style>
+ body {
+ line-height: 80px;
+ }
+ rtc, rt {
+ font-size: 100% !important;
+ line-height: 1 !important;
+ }
+ </style>
+</head>
+<body>
+ <ruby style="position: relative;">
+ <rb>base</rb>
+ <rtc><rt>a<span style="position: relative; top: -10px;">b</span>c</rt></rtc>
+ <rtc><div style="width: 50px; height: 0;"></div></rtc>
+ </ruby>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/css-ruby/relative-positioning-2-ref.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <title>Bug 1055658 - Relative positioning for ruby</title>
+ <style>
+ body {
+ font-family: monospace;
+ }
+ .annotation, .annotation > div {
+ position: absolute;
+ line-height: 1;
+ }
+ </style>
+</head>
+<body>
+ <div style="height: 80px; line-height: 80px;">
+ before
+ <div style="display: inline-block; line-height: normal; position: relative; top: 20px;">
+ <div class="annotation" style="top: 0; width: 100%;">
+ <div style="top: -100%;">
+ text1
+ <span style="position: relative; top: -20px;">text2</span>
+ <span style="position: relative; right: 10px;">text3</span>
+ </div>
+ <!-- to give container a nonzero size for
+ percent values to resolve against -->
+ </div>
+ base1
+ <span style="position: relative; left: 10px;">base2</span>
+ <span style="position: relative; bottom: -20px;">base3</span>
+ </div>
+ after
+ </div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/css-ruby/relative-positioning-2.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <title>Bug 1055658 - Relative positioning for ruby</title>
+ <link rel="stylesheet" href="common.css">
+ <style>
+ body {
+ font-family: monospace;
+ line-height: 80px;
+ }
+ rtc, rt {
+ font-size: 100% !important;
+ line-height: 1 !important;
+ }
+ </style>
+</head>
+<body>
+ before
+ <ruby style="position: relative; top: 20px;">
+ <rb>base1</rb>
+ <rtc>text1</rtc>
+ <rb style="position: relative; left: 10px;">base2</rb>
+ <rtc style="position: relative; top: -20px;">text2</rtc>
+ <rbc style="position: relative; bottom: -20px;"><rb>base3</rb></rbc>
+ <rtc><rt style="position: relative; right: 10px;">text3</rt></rtc>
+ </ruby>
+ after
+</body>
+</html>