mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-09 21:00:42 +02:00
Automatic update from web-platform-tests Add more offsetLeft/offsetTop for tests empty/space inline elements Besides the test for empty inline elements, this CL also adds tests for inline elements containing spaces that are leading/trailing of the lines, to test that offsetLeft/offsetTop still works regardless of space collapsing. Also rename the tests to follow the common naming convention. Bug: 953479 Change-Id: I1c447e205b48b7cc54b358e6e9c66dced05f4684 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1572538 Reviewed-by: Koji Ishii <kojii@chromium.org> Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org> Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org> Auto-Submit: Xianzhu Wang <wangxianzhu@chromium.org> Cr-Commit-Position: refs/heads/master@{#652167} -- wpt-commits: ebf30da797aaac8bc429dbc6c01297399223f8fe wpt-pr: 16390 --HG-- rename : testing/web-platform/tests/css/cssom-view/offsetTopLeftEmptyInline.html => testing/web-platform/tests/css/cssom-view/offsetTopLeft-empty-inline-offset.html rename : testing/web-platform/tests/css/cssom-view/offsetTopLeftInline.html => testing/web-platform/tests/css/cssom-view/offsetTopLeft-inline.html
32 lines
1 KiB
HTML
32 lines
1 KiB
HTML
<!DOCTYPE html>
|
|
<link rel="help" href="https://drafts.csswg.org/cssom-view-1/#extensions-to-the-htmlelement-interface">
|
|
<script src=/resources/testharness.js></script>
|
|
<script src=/resources/testharnessreport.js></script>
|
|
<style>
|
|
.container {
|
|
position: relative;
|
|
width: 8em;
|
|
height: 7em;
|
|
padding: 1em;
|
|
}
|
|
</style>
|
|
<div class="container" style="writing-mode:horizontal-tb;">
|
|
<br><span class="target"></span><span>ref</span>
|
|
</div>
|
|
<div class="container" style="writing-mode:vertical-lr;">
|
|
<br><span class="target"></span><span>ref</span>
|
|
</div>
|
|
<div class="container" style="writing-mode:vertical-rl;">
|
|
<br><span class="target"></span><span>ref</span>
|
|
</div>
|
|
<script>
|
|
var i = 0;
|
|
document.querySelectorAll('span.target').forEach((target) => {
|
|
var ref = target.nextSibling;
|
|
test(() => {
|
|
assert_equals(target.offsetLeft, ref.offsetLeft, 'offsetLeft');
|
|
assert_equals(target.offsetTop, ref.offsetTop, 'offsetTop');
|
|
}, 'offsetTop/Left of empty inline elements should work as if they were not empty: ' + i);
|
|
i++;
|
|
});
|
|
</script>
|