Commit 1936977a authored by Morten Stenshorne's avatar Morten Stenshorne Committed by Commit Bot

Add offsetLeft/offsetTop tests for non-atomic inlines.

Added a comment to LayoutInline, pointing out that LayoutNG seems to be
doing the right thing already, while legacy is wrong.

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: I0f906dab6efa7b3d4c72a297926d542f77251052
Reviewed-on: https://chromium-review.googlesource.com/c/1261575Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596657}
parent 392ebc5d
...@@ -191,6 +191,7 @@ crbug.com/591099 external/wpt/css/css-writing-modes/sizing-orthog-vrl-in-htb-004 ...@@ -191,6 +191,7 @@ crbug.com/591099 external/wpt/css/css-writing-modes/sizing-orthog-vrl-in-htb-004
crbug.com/591099 external/wpt/css/css-writing-modes/vertical-alignment-003.xht [ Pass ] crbug.com/591099 external/wpt/css/css-writing-modes/vertical-alignment-003.xht [ Pass ]
crbug.com/591099 external/wpt/css/css-writing-modes/vertical-alignment-009.xht [ Pass ] crbug.com/591099 external/wpt/css/css-writing-modes/vertical-alignment-009.xht [ Pass ]
crbug.com/591099 external/wpt/css/cssom/cssstyledeclaration-mutationrecord-001.html [ Pass ] crbug.com/591099 external/wpt/css/cssom/cssstyledeclaration-mutationrecord-001.html [ Pass ]
crbug.com/591099 external/wpt/css/cssom-view/offsetTopLeftInline.html [ Pass ]
crbug.com/591099 external/wpt/css/selectors/selector-placeholder-shown-type-change-001.html [ Pass ] crbug.com/591099 external/wpt/css/selectors/selector-placeholder-shown-type-change-001.html [ Pass ]
crbug.com/591099 external/wpt/css/selectors/selector-read-write-type-change-002.html [ Pass ] crbug.com/591099 external/wpt/css/selectors/selector-read-write-type-change-002.html [ Pass ]
crbug.com/591099 external/wpt/css/selectors/selector-required-type-change-002.html [ Pass ] crbug.com/591099 external/wpt/css/selectors/selector-required-type-change-002.html [ Pass ]
......
...@@ -415,6 +415,7 @@ crbug.com/859233 external/wpt/css/css-break/hit-test-inline-fragmentation-with-b ...@@ -415,6 +415,7 @@ crbug.com/859233 external/wpt/css/css-break/hit-test-inline-fragmentation-with-b
crbug.com/845902 external/wpt/css/css-sizing/whitespace-and-break.html [ Failure ] crbug.com/845902 external/wpt/css/css-sizing/whitespace-and-break.html [ Failure ]
crbug.com/591099 external/wpt/css/css-sizing/intrinsic-percent-non-replaced-004.html [ Failure ] crbug.com/591099 external/wpt/css/css-sizing/intrinsic-percent-non-replaced-004.html [ Failure ]
crbug.com/591099 external/wpt/css/css-sizing/intrinsic-percent-non-replaced-005.html [ Failure ] crbug.com/591099 external/wpt/css/css-sizing/intrinsic-percent-non-replaced-005.html [ Failure ]
crbug.com/591099 external/wpt/css/cssom-view/offsetTopLeftInline.html [ Failure ]
crbug.com/591099 tables/mozilla/bugs/bug14159-1.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug14159-1.html [ Failure ]
### virtual/layout_ng/external/wpt/css/CSS2/floats ### virtual/layout_ng/external/wpt/css/CSS2/floats
......
<!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>
...@@ -877,6 +877,12 @@ void LayoutInline::AbsoluteQuadsForSelf(Vector<FloatQuad>& quads, ...@@ -877,6 +877,12 @@ void LayoutInline::AbsoluteQuadsForSelf(Vector<FloatQuad>& quads,
} }
LayoutPoint LayoutInline::FirstLineBoxTopLeft() const { LayoutPoint LayoutInline::FirstLineBoxTopLeft() const {
// This method is called from various places. It's mainly (only?) about
// calculating offsetLeft and offsetTop, though. Thus the callers seem to
// expect a purely physical point. This is what NG does. Legacy, on the other
// hand, sets the block-axis coordinate relatively to the block-start border
// edge, which means that offsetLeft will be wrong when writing-mode is
// vertical-rl.
if (const NGPhysicalBoxFragment* box_fragment = if (const NGPhysicalBoxFragment* box_fragment =
EnclosingBlockFlowFragmentOf(*this)) { EnclosingBlockFlowFragmentOf(*this)) {
const auto& fragments = const auto& fragments =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment