Implement visibility: collapse support for ruby text.

Differential Revision: https://phabricator.services.mozilla.com/D107990

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1697529
gecko-commit: 42516933bcaf4dc4d99259b82445cab9673bb2a6
gecko-reviewers: dholbert
diff --git a/css/css-ruby/ruby-text-collapse-ref.html b/css/css-ruby/ruby-text-collapse-ref.html
new file mode 100644
index 0000000..6cbcc78
--- /dev/null
+++ b/css/css-ruby/ruby-text-collapse-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="ja">
+<meta charset="UTF-8">
+<title>CSS Reference: visibility: collapse hides ruby annotations</title>
+<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org">
+<style>
+  body { line-height: 5; }
+  rt { font-size: 80%; }
+</style>
+<ruby>
+  <rb>昆</rb><rb>虫</rb><rb>記</rb>
+  <rt>こん</rt><rt>ちゅう</rt><rt>き</rt>
+</ruby><br>
+<ruby>
+  <rb>昆</rb><rb>虫</rb><rb>記</rb>
+  <rt>こん</rt><rt style="opacity: 0">ちゅう</rt><rt>き</rt>
+</ruby><br>
+<ruby>
+  <rb>昆</rb><rb>虫</rb><rb>記</rb>
+  <rt>こん</rt><rt></rt><rt>き</rt>
+</ruby>
diff --git a/css/css-ruby/ruby-text-collapse.html b/css/css-ruby/ruby-text-collapse.html
new file mode 100644
index 0000000..5bb01aa
--- /dev/null
+++ b/css/css-ruby/ruby-text-collapse.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="ja">
+<meta charset="UTF-8">
+<title>CSS Test: visibility: collapse hides ruby annotations</title>
+<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org">
+<link rel="help" href="https://drafts.csswg.org/css-ruby-1/#hiding">
+<link rel="match" href="ruby-text-collapse-ref.html">
+<style>
+  body { line-height: 5; }
+  rt { font-size: 80%; }
+</style>
+<ruby>
+  <rb>昆</rb><rb>虫</rb><rb>記</rb>
+  <rt>こん</rt><rt>ちゅう</rt><rt>き</rt>
+</ruby><br>
+<ruby>
+  <rb>昆</rb><rb>虫</rb><rb>記</rb>
+  <rt>こん</rt><rt style="visibility: hidden">ちゅう</rt><rt>き</rt>
+</ruby><br>
+<ruby>
+  <rb>昆</rb><rb>虫</rb><rb>記</rb>
+  <rt>こん</rt><rt style="visibility: collapse">ちゅう</rt><rt>き</rt>
+</ruby>