Bug 1069519 part 3 - Add reftests for ruby line height calculation. r=dholbert
authorXidorn Quan <quanxunzhen@gmail.com>
Thu, 08 Jan 2015 16:02:41 +1100
changeset 248420 87ca345a376736ce695cbc157fdb280e9b4d911b
parent 248419 0491510520344b87bf4d035cc8e9c0bdaf372a71
child 248421 eab4b3520c509ec440cc648d795964b06b353d01
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1069519
milestone37.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 1069519 part 3 - Add reftests for ruby line height calculation. r=dholbert
layout/reftests/css-ruby/line-height-1-ref.html
layout/reftests/css-ruby/line-height-1.html
layout/reftests/css-ruby/line-height-2-ref.html
layout/reftests/css-ruby/line-height-2.html
layout/reftests/css-ruby/line-height-3-ref.html
layout/reftests/css-ruby/line-height-3.html
layout/reftests/css-ruby/reftest.list
layout/reftests/css-ruby/utils.js
new file mode 100644
--- /dev/null
+++ b/layout/reftests/css-ruby/line-height-1-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <title>Bug 1069519 - Ruby line height calculation</title>
+  <link rel="stylesheet" href="common.css">
+  <script type="text/javascript" src="utils.js"></script>
+</head>
+<body style="line-height: 1">
+  <div id="base" style="padding-top: .5em"><span id="inline">base</span></div>
+  <script>
+    // Simulate the behavior of ruby layout.
+    makeHeightMatchInlineBox(document.getElementById('base'),
+                             document.getElementById('inline'));
+  </script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/css-ruby/line-height-1.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <title>Bug 1069519 - Ruby line height calculation</title>
+  <link rel="stylesheet" href="common.css">
+</head>
+<body style="line-height: 1">
+  <ruby>
+    <rb>base</rb>
+    <rtc><rt style="color: transparent">text</rt></rtc>
+  </ruby>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/css-ruby/line-height-2-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <title>Bug 1069519 - Ruby line height calculation</title>
+  <link rel="stylesheet" href="common.css">
+  <script type="text/javascript" src="utils.js"></script>
+</head>
+<body style="line-height: 1">
+  <div id="base" style="padding-bottom: .5em"><span id="inline">base</span></div>
+  next line
+  <script>
+    // Simulate the behavior of ruby layout.
+    makeHeightMatchInlineBox(document.getElementById('base'),
+                             document.getElementById('inline'));
+  </script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/css-ruby/line-height-2.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <title>Bug 1069519 - Ruby line height calculation</title>
+  <link rel="stylesheet" href="common.css">
+</head>
+<body style="line-height: 1">
+  <ruby>
+    <rb>base</rb>
+    <rtc style="ruby-position: under left;"><rt style="color: transparent">text</rt></rtc>
+  </ruby><br>
+  next line
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/css-ruby/line-height-3-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <title>Bug 1069519 - Ruby line height calculation</title>
+  <link rel="stylesheet" href="common.css">
+  <script type="text/javascript" src="utils.js"></script>
+</head>
+<body style="line-height: 1">
+  <div id="base" style="padding: .8em 0 .5em"><span id="inline">base</span></div>
+  next line
+  <script>
+    // Simulate the behavior of ruby layout.
+    makeHeightMatchInlineBox(document.getElementById('base'),
+                             document.getElementById('inline'));
+  </script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/css-ruby/line-height-3.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <title>Bug 1069519 - Ruby line height calculation</title>
+  <link rel="stylesheet" href="common.css">
+</head>
+<body style="line-height: 1">
+  <ruby>
+    <rb>base</rb>
+    <rtc style="ruby-position: over left; font-size: 80%;"><rt style="color: transparent">text</rt></rtc>
+    <rtc style="ruby-position: under left; font-size: 50%;"><rt style="color: transparent">text</rt></rtc>
+  </ruby><br>
+  next line
+</body>
+</html>
--- a/layout/reftests/css-ruby/reftest.list
+++ b/layout/reftests/css-ruby/reftest.list
@@ -17,16 +17,19 @@ fuzzy-if(winWidget,35,1) == dynamic-remo
 == float-handling.html float-handling-ref.html
 == inlinize-blocks-1.html inlinize-blocks-1-ref.html
 == inlinize-blocks-2.html inlinize-blocks-2-ref.html
 == inlinize-blocks-3.html inlinize-blocks-3-ref.html
 == inlinize-blocks-4.html inlinize-blocks-4-ref.html
 == inlinize-blocks-5.html inlinize-blocks-5-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
 == 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/utils.js
@@ -0,0 +1,5 @@
+function makeHeightMatchInlineBox(block, inline) {
+  var height = inline.getBoundingClientRect().height + 'px';
+  block.style.height = height;
+  block.style.lineHeight = height;
+}