mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-11 21:58:41 +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
54 lines
1.8 KiB
HTML
54 lines
1.8 KiB
HTML
<!DOCTYPE html>
|
|
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
|
|
<link rel="help" href="https://drafts.csswg.org/cssom-view-1/#extensions-to-the-htmlelement-interface">
|
|
<link rel="match" href="../reference/nothing.html">
|
|
<style>
|
|
.container {
|
|
float: left;
|
|
width: 8em;
|
|
height: 7em;
|
|
padding: 1em;
|
|
color: red;
|
|
}
|
|
.correctionFluid {
|
|
position: absolute;
|
|
background: white;
|
|
|
|
/* Add some fluff to cover text ink-overflow. */
|
|
outline:2px solid white;
|
|
}
|
|
</style>
|
|
<p>There should be nothing below.</p>
|
|
<div class="container" style="writing-mode:horizontal-tb;">
|
|
<br><span class="child">FAIL</span>
|
|
</div>
|
|
<div class="container" style="writing-mode:vertical-lr;">
|
|
<br><span class="child">FAIL</span>
|
|
</div>
|
|
<div class="container" style="writing-mode:vertical-rl;">
|
|
<br><span class="child">FAIL</span>
|
|
</div>
|
|
<div class="container" style="writing-mode:horizontal-tb; direction:rtl;">
|
|
<br><span class="child">FAIL</span>
|
|
</div>
|
|
<div class="container" style="writing-mode:vertical-lr; direction:rtl;">
|
|
<br><span class="child">FAIL</span>
|
|
</div>
|
|
<div class="container" style="writing-mode:vertical-rl; direction:rtl;">
|
|
<br><span class="child">FAIL</span>
|
|
</div>
|
|
<script>
|
|
// Create a white absolutely positioned box for each span.child
|
|
// element and cover it.
|
|
|
|
let elements = document.querySelectorAll("span.child");
|
|
elements.forEach((element)=> {
|
|
let correctionFluid = document.createElement("div");
|
|
correctionFluid.className = "correctionFluid";
|
|
correctionFluid.style.left = element.offsetLeft + "px";
|
|
correctionFluid.style.top = element.offsetTop + "px";
|
|
correctionFluid.style.width = element.offsetWidth + "px";
|
|
correctionFluid.style.height = element.offsetHeight + "px";
|
|
document.body.appendChild(correctionFluid);
|
|
});
|
|
</script>
|