From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- layout/reftests/css-ruby/box-properties-1-ref.html | 17 ++++++++++ layout/reftests/css-ruby/box-properties-1.html | 21 ++++++++++++ layout/reftests/css-ruby/box-properties-2-ref.html | 29 +++++++++++++++++ layout/reftests/css-ruby/box-properties-2.html | 25 ++++++++++++++ layout/reftests/css-ruby/box-properties-3-ref.html | 18 ++++++++++ layout/reftests/css-ruby/box-properties-3.html | 18 ++++++++++ layout/reftests/css-ruby/box-properties-4-ref.html | 24 ++++++++++++++ layout/reftests/css-ruby/box-properties-4.html | 23 +++++++++++++ layout/reftests/css-ruby/bug1181890-notref.html | 9 +++++ layout/reftests/css-ruby/bug1181890-ref.html | 9 +++++ layout/reftests/css-ruby/bug1181890.html | 10 ++++++ layout/reftests/css-ruby/common.css | 22 +++++++++++++ layout/reftests/css-ruby/inflated-ruby-1-ref.html | 6 ++++ layout/reftests/css-ruby/inflated-ruby-1.html | 10 ++++++ layout/reftests/css-ruby/line-height-1-ref.html | 21 ++++++++++++ layout/reftests/css-ruby/line-height-1.html | 14 ++++++++ layout/reftests/css-ruby/line-height-2-ref.html | 22 +++++++++++++ layout/reftests/css-ruby/line-height-2.html | 15 +++++++++ layout/reftests/css-ruby/line-height-3-ref.html | 24 ++++++++++++++ layout/reftests/css-ruby/line-height-3.html | 16 +++++++++ layout/reftests/css-ruby/line-height-4-ref.html | 15 +++++++++ layout/reftests/css-ruby/line-height-4.html | 7 ++++ layout/reftests/css-ruby/min-font-size-1-ref.html | 13 ++++++++ layout/reftests/css-ruby/min-font-size-1.html | 13 ++++++++ layout/reftests/css-ruby/nested-ruby-1.html | 19 +++++++++++ layout/reftests/css-ruby/reftest.list | 33 +++++++++++++++++++ .../css-ruby/relative-positioning-1-ref.html | 22 +++++++++++++ .../reftests/css-ruby/relative-positioning-1.html | 24 ++++++++++++++ .../css-ruby/relative-positioning-2-ref.html | 30 +++++++++++++++++ .../reftests/css-ruby/relative-positioning-2.html | 30 +++++++++++++++++ .../css-ruby/ruby-intercharacter-1-ref.htm | 34 +++++++++++++++++++ layout/reftests/css-ruby/ruby-intercharacter-1.htm | 24 ++++++++++++++ .../css-ruby/ruby-intercharacter-2-ref.htm | 28 ++++++++++++++++ layout/reftests/css-ruby/ruby-intercharacter-2.htm | 23 +++++++++++++ .../css-ruby/ruby-position-horizontal-ref.html | 35 ++++++++++++++++++++ .../css-ruby/ruby-position-horizontal.html | 28 ++++++++++++++++ .../css-ruby/ruby-position-vertical-lr-ref.html | 38 ++++++++++++++++++++++ .../css-ruby/ruby-position-vertical-lr.html | 31 ++++++++++++++++++ .../css-ruby/ruby-position-vertical-rl-ref.html | 38 ++++++++++++++++++++++ .../css-ruby/ruby-position-vertical-rl.html | 31 ++++++++++++++++++ layout/reftests/css-ruby/utils.js | 33 +++++++++++++++++++ 41 files changed, 902 insertions(+) create mode 100644 layout/reftests/css-ruby/box-properties-1-ref.html create mode 100644 layout/reftests/css-ruby/box-properties-1.html create mode 100644 layout/reftests/css-ruby/box-properties-2-ref.html create mode 100644 layout/reftests/css-ruby/box-properties-2.html create mode 100644 layout/reftests/css-ruby/box-properties-3-ref.html create mode 100644 layout/reftests/css-ruby/box-properties-3.html create mode 100644 layout/reftests/css-ruby/box-properties-4-ref.html create mode 100644 layout/reftests/css-ruby/box-properties-4.html create mode 100644 layout/reftests/css-ruby/bug1181890-notref.html create mode 100644 layout/reftests/css-ruby/bug1181890-ref.html create mode 100644 layout/reftests/css-ruby/bug1181890.html create mode 100644 layout/reftests/css-ruby/common.css create mode 100644 layout/reftests/css-ruby/inflated-ruby-1-ref.html create mode 100644 layout/reftests/css-ruby/inflated-ruby-1.html create mode 100644 layout/reftests/css-ruby/line-height-1-ref.html create mode 100644 layout/reftests/css-ruby/line-height-1.html create mode 100644 layout/reftests/css-ruby/line-height-2-ref.html create mode 100644 layout/reftests/css-ruby/line-height-2.html create mode 100644 layout/reftests/css-ruby/line-height-3-ref.html create mode 100644 layout/reftests/css-ruby/line-height-3.html create mode 100644 layout/reftests/css-ruby/line-height-4-ref.html create mode 100644 layout/reftests/css-ruby/line-height-4.html create mode 100644 layout/reftests/css-ruby/min-font-size-1-ref.html create mode 100644 layout/reftests/css-ruby/min-font-size-1.html create mode 100644 layout/reftests/css-ruby/nested-ruby-1.html create mode 100644 layout/reftests/css-ruby/reftest.list create mode 100644 layout/reftests/css-ruby/relative-positioning-1-ref.html create mode 100644 layout/reftests/css-ruby/relative-positioning-1.html create mode 100644 layout/reftests/css-ruby/relative-positioning-2-ref.html create mode 100644 layout/reftests/css-ruby/relative-positioning-2.html create mode 100644 layout/reftests/css-ruby/ruby-intercharacter-1-ref.htm create mode 100644 layout/reftests/css-ruby/ruby-intercharacter-1.htm create mode 100644 layout/reftests/css-ruby/ruby-intercharacter-2-ref.htm create mode 100644 layout/reftests/css-ruby/ruby-intercharacter-2.htm create mode 100644 layout/reftests/css-ruby/ruby-position-horizontal-ref.html create mode 100644 layout/reftests/css-ruby/ruby-position-horizontal.html create mode 100644 layout/reftests/css-ruby/ruby-position-vertical-lr-ref.html create mode 100644 layout/reftests/css-ruby/ruby-position-vertical-lr.html create mode 100644 layout/reftests/css-ruby/ruby-position-vertical-rl-ref.html create mode 100644 layout/reftests/css-ruby/ruby-position-vertical-rl.html create mode 100644 layout/reftests/css-ruby/utils.js (limited to 'layout/reftests/css-ruby') diff --git a/layout/reftests/css-ruby/box-properties-1-ref.html b/layout/reftests/css-ruby/box-properties-1-ref.html new file mode 100644 index 0000000000..a8e340653d --- /dev/null +++ b/layout/reftests/css-ruby/box-properties-1-ref.html @@ -0,0 +1,17 @@ + + + + + Bug 1055667 - Box properties on ruby boxes + + +
+ |base1 + +
base2
+ base3
| +
+ + diff --git a/layout/reftests/css-ruby/box-properties-1.html b/layout/reftests/css-ruby/box-properties-1.html new file mode 100644 index 0000000000..1b463eb5b8 --- /dev/null +++ b/layout/reftests/css-ruby/box-properties-1.html @@ -0,0 +1,21 @@ + + + + + Bug 1055667 - Box properties on ruby boxes + + + +
+ | + base1 + base2 + base3 + + +
+
+
| +
+ + diff --git a/layout/reftests/css-ruby/box-properties-2-ref.html b/layout/reftests/css-ruby/box-properties-2-ref.html new file mode 100644 index 0000000000..5abfa2e84c --- /dev/null +++ b/layout/reftests/css-ruby/box-properties-2-ref.html @@ -0,0 +1,29 @@ + + + + + Bug 1055667 - Box properties on ruby boxes + + + + + + base1 +
+ base3 + + +
text1
+ + +
+
+ + + diff --git a/layout/reftests/css-ruby/box-properties-2.html b/layout/reftests/css-ruby/box-properties-2.html new file mode 100644 index 0000000000..ca12016937 --- /dev/null +++ b/layout/reftests/css-ruby/box-properties-2.html @@ -0,0 +1,25 @@ + + + + + Bug 1055667 - Box properties on ruby boxes + + + + + + base1 +
+ base3 + + +
text1
+
+
+ + + diff --git a/layout/reftests/css-ruby/box-properties-3-ref.html b/layout/reftests/css-ruby/box-properties-3-ref.html new file mode 100644 index 0000000000..465e547584 --- /dev/null +++ b/layout/reftests/css-ruby/box-properties-3-ref.html @@ -0,0 +1,18 @@ + + + + + Bug 1055667 - Box properties on ruby boxes + + + + + + base1 + + + text1 + + + + diff --git a/layout/reftests/css-ruby/box-properties-3.html b/layout/reftests/css-ruby/box-properties-3.html new file mode 100644 index 0000000000..6b014c2681 --- /dev/null +++ b/layout/reftests/css-ruby/box-properties-3.html @@ -0,0 +1,18 @@ + + + + + Bug 1055667 - Box properties on ruby boxes + + + + + + base1 + + + text1 + + + + diff --git a/layout/reftests/css-ruby/box-properties-4-ref.html b/layout/reftests/css-ruby/box-properties-4-ref.html new file mode 100644 index 0000000000..db6788daa2 --- /dev/null +++ b/layout/reftests/css-ruby/box-properties-4-ref.html @@ -0,0 +1,24 @@ + + + + + Bug 1055667 - Box properties on ruby boxes + + + + +
+
+
+ + diff --git a/layout/reftests/css-ruby/box-properties-4.html b/layout/reftests/css-ruby/box-properties-4.html new file mode 100644 index 0000000000..6e953bc3a1 --- /dev/null +++ b/layout/reftests/css-ruby/box-properties-4.html @@ -0,0 +1,23 @@ + + + + + Bug 1055667 - Box properties on ruby boxes + + + + +
+
+
+ + diff --git a/layout/reftests/css-ruby/bug1181890-notref.html b/layout/reftests/css-ruby/bug1181890-notref.html new file mode 100644 index 0000000000..0e97415a88 --- /dev/null +++ b/layout/reftests/css-ruby/bug1181890-notref.html @@ -0,0 +1,9 @@ + +

+ Aaaaaaaaaaaaa + BBBBBb +

+

+ Aaaaaaaaaaaaa + BBBBBb +

diff --git a/layout/reftests/css-ruby/bug1181890-ref.html b/layout/reftests/css-ruby/bug1181890-ref.html new file mode 100644 index 0000000000..41a46d13e3 --- /dev/null +++ b/layout/reftests/css-ruby/bug1181890-ref.html @@ -0,0 +1,9 @@ + +

+ Aaaaaaaaaaaaa + BBBBBb +

+

+ Aaaaaaaaaaaaa + BBBBBb +

diff --git a/layout/reftests/css-ruby/bug1181890.html b/layout/reftests/css-ruby/bug1181890.html new file mode 100644 index 0000000000..3369a7482d --- /dev/null +++ b/layout/reftests/css-ruby/bug1181890.html @@ -0,0 +1,10 @@ + +

+ Aaaaaaaaaaaaa + BBBBBb +

+

+ Aaaaaaaaaaaaa + BBBBBb +

+‎ diff --git a/layout/reftests/css-ruby/common.css b/layout/reftests/css-ruby/common.css new file mode 100644 index 0000000000..45bdd379cb --- /dev/null +++ b/layout/reftests/css-ruby/common.css @@ -0,0 +1,22 @@ +@font-face { + font-family: Ahem; + src: url(../fonts/Ahem.ttf); +} +rbc { + display: ruby-base-container; + unicode-bidi: isolate; +} +[pseudo] { + font-size: inherit; + line-height: inherit; +} +[pseudo] > rt { + font-size: 50%; +} +[pseudo] > rt[pseudo] { + font-size: inherit; +} + +.large { + font-size: 200%; +} diff --git a/layout/reftests/css-ruby/inflated-ruby-1-ref.html b/layout/reftests/css-ruby/inflated-ruby-1-ref.html new file mode 100644 index 0000000000..7ae6e58258 --- /dev/null +++ b/layout/reftests/css-ruby/inflated-ruby-1-ref.html @@ -0,0 +1,6 @@ + + +
baserubytext
diff --git a/layout/reftests/css-ruby/inflated-ruby-1.html b/layout/reftests/css-ruby/inflated-ruby-1.html new file mode 100644 index 0000000000..f9c6f19474 --- /dev/null +++ b/layout/reftests/css-ruby/inflated-ruby-1.html @@ -0,0 +1,10 @@ + + + +
baserubytext
diff --git a/layout/reftests/css-ruby/line-height-1-ref.html b/layout/reftests/css-ruby/line-height-1-ref.html new file mode 100644 index 0000000000..821765f5c3 --- /dev/null +++ b/layout/reftests/css-ruby/line-height-1-ref.html @@ -0,0 +1,21 @@ + + + + + Bug 1069519 - Ruby line height calculation + + + + +
+ base + text +
+ + + diff --git a/layout/reftests/css-ruby/line-height-1.html b/layout/reftests/css-ruby/line-height-1.html new file mode 100644 index 0000000000..fc7463e381 --- /dev/null +++ b/layout/reftests/css-ruby/line-height-1.html @@ -0,0 +1,14 @@ + + + + + Bug 1069519 - Ruby line height calculation + + + + + base + text + + + diff --git a/layout/reftests/css-ruby/line-height-2-ref.html b/layout/reftests/css-ruby/line-height-2-ref.html new file mode 100644 index 0000000000..3d506e4e9b --- /dev/null +++ b/layout/reftests/css-ruby/line-height-2-ref.html @@ -0,0 +1,22 @@ + + + + + Bug 1069519 - Ruby line height calculation + + + + +
+ base + text +
+ next line + + + diff --git a/layout/reftests/css-ruby/line-height-2.html b/layout/reftests/css-ruby/line-height-2.html new file mode 100644 index 0000000000..d84f31da4e --- /dev/null +++ b/layout/reftests/css-ruby/line-height-2.html @@ -0,0 +1,15 @@ + + + + + Bug 1069519 - Ruby line height calculation + + + + + base + text +
+ next line + + diff --git a/layout/reftests/css-ruby/line-height-3-ref.html b/layout/reftests/css-ruby/line-height-3-ref.html new file mode 100644 index 0000000000..8a186c5f25 --- /dev/null +++ b/layout/reftests/css-ruby/line-height-3-ref.html @@ -0,0 +1,24 @@ + + + + + Bug 1069519 - Ruby line height calculation + + + + +
+ base + text + text +
+ next line + + + diff --git a/layout/reftests/css-ruby/line-height-3.html b/layout/reftests/css-ruby/line-height-3.html new file mode 100644 index 0000000000..ea2bf632af --- /dev/null +++ b/layout/reftests/css-ruby/line-height-3.html @@ -0,0 +1,16 @@ + + + + + Bug 1069519 - Ruby line height calculation + + + + + base + text + text +
+ next line + + diff --git a/layout/reftests/css-ruby/line-height-4-ref.html b/layout/reftests/css-ruby/line-height-4-ref.html new file mode 100644 index 0000000000..4ef96858e1 --- /dev/null +++ b/layout/reftests/css-ruby/line-height-4-ref.html @@ -0,0 +1,15 @@ +Bug 1134206 - Ruby line spacing adjustment on quirks mode + +
+ base + text + text +
+next line + diff --git a/layout/reftests/css-ruby/line-height-4.html b/layout/reftests/css-ruby/line-height-4.html new file mode 100644 index 0000000000..978aa5c70b --- /dev/null +++ b/layout/reftests/css-ruby/line-height-4.html @@ -0,0 +1,7 @@ +Bug 1134206 - Ruby line spacing adjustment on quirks mode + + base + text + text +
+next line diff --git a/layout/reftests/css-ruby/min-font-size-1-ref.html b/layout/reftests/css-ruby/min-font-size-1-ref.html new file mode 100644 index 0000000000..93b4bba2cd --- /dev/null +++ b/layout/reftests/css-ruby/min-font-size-1-ref.html @@ -0,0 +1,13 @@ + + + + + Bug 1165538 - Minimum font size on ruby text + + + + 超電磁砲 + レールガン + + + diff --git a/layout/reftests/css-ruby/min-font-size-1.html b/layout/reftests/css-ruby/min-font-size-1.html new file mode 100644 index 0000000000..150e032216 --- /dev/null +++ b/layout/reftests/css-ruby/min-font-size-1.html @@ -0,0 +1,13 @@ + + + + + Bug 1165538 - Minimum font size on ruby text + + + + 超電磁砲 + レールガン + + + diff --git a/layout/reftests/css-ruby/nested-ruby-1.html b/layout/reftests/css-ruby/nested-ruby-1.html new file mode 100644 index 0000000000..b3e76768e8 --- /dev/null +++ b/layout/reftests/css-ruby/nested-ruby-1.html @@ -0,0 +1,19 @@ + + + + + Bug 1120313 - Nested ruby inside ruby annotation + + + + + base1 + + + base2 + text + + + + + diff --git a/layout/reftests/css-ruby/reftest.list b/layout/reftests/css-ruby/reftest.list new file mode 100644 index 0000000000..e432c79426 --- /dev/null +++ b/layout/reftests/css-ruby/reftest.list @@ -0,0 +1,33 @@ +# Box properties support on ruby boxes are not specified. +== box-properties-1.html box-properties-1-ref.html +== box-properties-2.html box-properties-2-ref.html +== box-properties-3.html box-properties-3-ref.html +== box-properties-4.html box-properties-4-ref.html + +# These tests browser features. +test-pref(dom.meta-viewport.enabled,true) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == inflated-ruby-1.html inflated-ruby-1-ref.html +test-pref(font.minimum-size.ja,16) == min-font-size-1.html min-font-size-1-ref.html + +# These tests rely on height of inline elements which is unspecified. +== 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 +== line-height-4.html line-height-4-ref.html +== relative-positioning-1.html relative-positioning-1-ref.html +== relative-positioning-2.html relative-positioning-2-ref.html +== ruby-position-horizontal.html ruby-position-horizontal-ref.html +== ruby-position-vertical-lr.html ruby-position-vertical-lr-ref.html +== ruby-position-vertical-rl.html ruby-position-vertical-rl-ref.html + +# Nested ruby should not crash. +load nested-ruby-1.html + +# Inter-character ruby is not enabled, and its spec is not considered stable enough. +pref(layout.css.ruby.intercharacter.enabled,true) fuzzy-if(Android,0-198,0-70) == ruby-intercharacter-1.htm ruby-intercharacter-1-ref.htm +pref(layout.css.ruby.intercharacter.enabled,false) != ruby-intercharacter-1.htm ruby-intercharacter-1-ref.htm +pref(layout.css.ruby.intercharacter.enabled,true) == ruby-intercharacter-2.htm ruby-intercharacter-2-ref.htm +pref(layout.css.ruby.intercharacter.enabled,false) != ruby-intercharacter-2.htm ruby-intercharacter-2-ref.htm + +# Testing a specific bug for RTL handling. +== bug1181890.html bug1181890-ref.html +!= bug1181890.html bug1181890-notref.html diff --git a/layout/reftests/css-ruby/relative-positioning-1-ref.html b/layout/reftests/css-ruby/relative-positioning-1-ref.html new file mode 100644 index 0000000000..1819ba920e --- /dev/null +++ b/layout/reftests/css-ruby/relative-positioning-1-ref.html @@ -0,0 +1,22 @@ + + + + + Bug 1055658 - Relative positioning for ruby + + + +
+ +
+ abc +
+ base +
+
+ + + diff --git a/layout/reftests/css-ruby/relative-positioning-1.html b/layout/reftests/css-ruby/relative-positioning-1.html new file mode 100644 index 0000000000..66dcf62c7c --- /dev/null +++ b/layout/reftests/css-ruby/relative-positioning-1.html @@ -0,0 +1,24 @@ + + + + + Bug 1055658 - Relative positioning for ruby + + + + + + base + abc +
+
+ + diff --git a/layout/reftests/css-ruby/relative-positioning-2-ref.html b/layout/reftests/css-ruby/relative-positioning-2-ref.html new file mode 100644 index 0000000000..a5fc13090e --- /dev/null +++ b/layout/reftests/css-ruby/relative-positioning-2-ref.html @@ -0,0 +1,30 @@ + + + + + Bug 1055658 - Relative positioning for ruby + + + +
+ before +
+ +
+ text1 + text2 + text3 +
+ base1 + base2 + base3 +
+
+ after +
+ + + diff --git a/layout/reftests/css-ruby/relative-positioning-2.html b/layout/reftests/css-ruby/relative-positioning-2.html new file mode 100644 index 0000000000..0e91b7b379 --- /dev/null +++ b/layout/reftests/css-ruby/relative-positioning-2.html @@ -0,0 +1,30 @@ + + + + + Bug 1055658 - Relative positioning for ruby + + + + + before + + base1 + text1 + base2 + text2 + base3 + text3 + + after + + diff --git a/layout/reftests/css-ruby/ruby-intercharacter-1-ref.htm b/layout/reftests/css-ruby/ruby-intercharacter-1-ref.htm new file mode 100644 index 0000000000..6327ad90f7 --- /dev/null +++ b/layout/reftests/css-ruby/ruby-intercharacter-1-ref.htm @@ -0,0 +1,34 @@ + + + + + + + + +
+ BASERT +
+ + diff --git a/layout/reftests/css-ruby/ruby-intercharacter-1.htm b/layout/reftests/css-ruby/ruby-intercharacter-1.htm new file mode 100644 index 0000000000..bb681a286b --- /dev/null +++ b/layout/reftests/css-ruby/ruby-intercharacter-1.htm @@ -0,0 +1,24 @@ + + + + + + + + + + BASERT + + + diff --git a/layout/reftests/css-ruby/ruby-intercharacter-2-ref.htm b/layout/reftests/css-ruby/ruby-intercharacter-2-ref.htm new file mode 100644 index 0000000000..90d47ae1d5 --- /dev/null +++ b/layout/reftests/css-ruby/ruby-intercharacter-2-ref.htm @@ -0,0 +1,28 @@ + + + + + + + + + + BASELONGRT + + + diff --git a/layout/reftests/css-ruby/ruby-intercharacter-2.htm b/layout/reftests/css-ruby/ruby-intercharacter-2.htm new file mode 100644 index 0000000000..2819784f16 --- /dev/null +++ b/layout/reftests/css-ruby/ruby-intercharacter-2.htm @@ -0,0 +1,23 @@ + + + + + + + + + + BASELONGRT + + + diff --git a/layout/reftests/css-ruby/ruby-position-horizontal-ref.html b/layout/reftests/css-ruby/ruby-position-horizontal-ref.html new file mode 100644 index 0000000000..9cb0ceaf4f --- /dev/null +++ b/layout/reftests/css-ruby/ruby-position-horizontal-ref.html @@ -0,0 +1,35 @@ + + + + + Bug 1055665 - Test for ruby-position + + + + + +
+
+
+
over##
+
under#
+
over2#
+
under2
+ +   +
+ base## +
+
+ + + diff --git a/layout/reftests/css-ruby/ruby-position-horizontal.html b/layout/reftests/css-ruby/ruby-position-horizontal.html new file mode 100644 index 0000000000..e6d9e8393b --- /dev/null +++ b/layout/reftests/css-ruby/ruby-position-horizontal.html @@ -0,0 +1,28 @@ + + + + + Bug 1055665 - Test for ruby-position + + + + + + base## + over## + under# + over2# + under2 + + + diff --git a/layout/reftests/css-ruby/ruby-position-vertical-lr-ref.html b/layout/reftests/css-ruby/ruby-position-vertical-lr-ref.html new file mode 100644 index 0000000000..2c432e4240 --- /dev/null +++ b/layout/reftests/css-ruby/ruby-position-vertical-lr-ref.html @@ -0,0 +1,38 @@ + + + + + Bug 1055665 - Test for ruby-position + + + + + +
+
+
+
left##
+
right#
+
left2#
+
right2
+ +   +
+ base## +
+
+ + + diff --git a/layout/reftests/css-ruby/ruby-position-vertical-lr.html b/layout/reftests/css-ruby/ruby-position-vertical-lr.html new file mode 100644 index 0000000000..6dee8f7ccb --- /dev/null +++ b/layout/reftests/css-ruby/ruby-position-vertical-lr.html @@ -0,0 +1,31 @@ + + + + + Bug 1055665 - Test for ruby-position + + + + + + base## + left## + right# + left2# + right2 + + + diff --git a/layout/reftests/css-ruby/ruby-position-vertical-rl-ref.html b/layout/reftests/css-ruby/ruby-position-vertical-rl-ref.html new file mode 100644 index 0000000000..edeeeb5f4b --- /dev/null +++ b/layout/reftests/css-ruby/ruby-position-vertical-rl-ref.html @@ -0,0 +1,38 @@ + + + + + Bug 1055665 - Test for ruby-position + + + + + +
+
+
+
left##
+
right#
+
left2#
+
right2
+ +   +
+ base## +
+
+ + + diff --git a/layout/reftests/css-ruby/ruby-position-vertical-rl.html b/layout/reftests/css-ruby/ruby-position-vertical-rl.html new file mode 100644 index 0000000000..1d93781764 --- /dev/null +++ b/layout/reftests/css-ruby/ruby-position-vertical-rl.html @@ -0,0 +1,31 @@ + + + + + Bug 1055665 - Test for ruby-position + + + + + + base## + left## + right# + left2# + right2 + + + diff --git a/layout/reftests/css-ruby/utils.js b/layout/reftests/css-ruby/utils.js new file mode 100644 index 0000000000..1fee84cc2d --- /dev/null +++ b/layout/reftests/css-ruby/utils.js @@ -0,0 +1,33 @@ +function getBlockAxisName(elem) { + var wm = getComputedStyle(elem).writingMode; + return (!wm || wm == 'horizontal-tb') ? 'height' : 'width'; +} + +function getBSize(elem) { + return elem.getBoundingClientRect()[getBlockAxisName(elem)] + 'px'; +} + +function setBSize(elem, bsize) { + elem.style[getBlockAxisName(elem)] = bsize; + elem.style.lineHeight = bsize; +} + +// Ruby annotations are placed based on block-axis size of inline boxes +// instead of line box. Block-axis size of an inline box is the max +// height of the font, while that of line box is line height. Hence we +// sometimes need to explicitly set the block-axis size of an inline +// box to a block to simulate the exact behavior, which is what the +// following two functions do. + +function makeBSizeMatchInlineBox(block, inline) { + setBSize(block, getBSize(inline)); +} + +function makeBSizeOfParentMatch(elems) { + // The size change is divided into two phases to avoid + // triggering reflow for every element. + for (var elem of elems) + elem.dataset.bsize = getBSize(elem); + for (var elem of elems) + setBSize(elem.parentNode, elem.dataset.bsize); +} -- cgit v1.2.3