Commit a3667f66 authored by Jonathan Kew's avatar Jonathan Kew Committed by jkew@mozilla.com
Browse files

Bug 1966668 - Explicitly load the Ahem font in css/css-ruby/line-spacing.html...

Bug 1966668 - Explicitly load the Ahem font in css/css-ruby/line-spacing.html r=layout-reviewers,emilio

Differential Revision: https://phabricator.services.mozilla.com/D249593
parent c6a07a65
Loading
Loading
Loading
Loading
+125 −115
Original line number Original line Diff line number Diff line
@@ -23,11 +23,17 @@ body > div {
  text-emphasis: 'x';
  text-emphasis: 'x';
  text-emphasis-position: under left;
  text-emphasis-position: under left;
}
}

#log {
  font-family: sans-serif;
}
</style>
</style>
<body>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
<script>
setup({ explicit_done: true });

function renderRuby(source) {
function renderRuby(source) {
  document.body.insertAdjacentHTML('afterbegin', source);
  document.body.insertAdjacentHTML('afterbegin', source);
  const firstChild = document.body.firstChild;
  const firstChild = document.body.firstChild;
@@ -45,6 +51,7 @@ function renderRubyAndGetBoxes(source) {
  };
  };
}
}


document.fonts.load("16px Ahem").then(() => {
  test(() => {
  test(() => {
    const {container, ruby, rt} = renderRubyAndGetBoxes(
    const {container, ruby, rt} = renderRubyAndGetBoxes(
        '<div><ruby>base<rt>annotation</rt></ruby></div>');
        '<div><ruby>base<rt>annotation</rt></ruby></div>');
@@ -160,5 +167,8 @@ test(() => {
    const rtBox = rt.getBoundingClientRect();
    const rtBox = rt.getBoundingClientRect();
    assert_greater_than_equal(rtBox.top, firstLine.bottom);
    assert_greater_than_equal(rtBox.top, firstLine.bottom);
  }, 'An atomic-inline should not overlap with an annotation in the next line');
  }, 'An atomic-inline should not overlap with an annotation in the next line');

  done();
});
</script>
</script>
</body>
</body>