mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-13 20:14:57 -10: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 <[email protected]> Reviewed-by: Xiaocheng Hu <[email protected]> Commit-Queue: Xianzhu Wang <[email protected]> Auto-Submit: Xianzhu Wang <[email protected]> Cr-Commit-Position: refs/heads/master@{#652167} -- wpt-commits: ebf30da797aaac8bc429dbc6c01297399223f8fe wpt-pr: 16390
33 lines
1.0 KiB
HTML
33 lines
1.0 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>
|