Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/cssom-view/offsetTopLeft-leading-space-inline.html - WPT Dashboard Interop Dashboard
<!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>