gecko-dev/testing/web-platform/tests/css/cssom-view/getBoundingClientRect-empty-inline.html
Luke Zielinski c3e453c7cd Bug 1579194 [wpt PR 18877] - Lint rule for using Ahem as a web font., a=testonly
Automatic update from web-platform-tests
Lint rule for using Ahem as a web font. (#18877)

Add a lint rule to check for tests that use the Ahem font but do not
include the /fonts/ahem.css stylesheet (which loads this font as a web
font). This prevents tests from assuming that Ahem is installed as a
system font. Also includes some unit tests.

There are a few tests that are incorrectly flagged as violating this
rule, these were added to lint.whitelist.

A bunch of other tests were fixed to load Ahem as a web font.
--

wpt-commits: c66230eebbea3bce8c086572869eb0835fb183b5
wpt-pr: 18877
2019-09-14 08:51:32 +00:00

35 lines
928 B
HTML

<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-getboundingclientrect">
<link rel="author" title="Koji Ishii" href="mailto:kojii@chromium.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
div {
font: 10px/1 Ahem;
}
.inline-block {
display: inline-block;
height: 100px;
}
</style>
<body>
<div>
<span id="empty"></span>
<span class="inline-block"></span>
</div>
<script>
document.fonts.ready.then(() => {
run(document.getElementById('empty'));
function run(element) {
test(() => {
let rect = element.getBoundingClientRect();
let cb = element.parentElement;
let cb_rect = cb.getBoundingClientRect();
assert_equals(rect.y - cb_rect.y, 92, "y");
assert_equals(rect.height, 10, "height");
});
}
});
</script>
</body>