gecko-dev/testing/web-platform/tests/css/css-contain/reference/contain-layout-baseline-004-ref.html
Manuel Rego Casasnovas f3570a4abf Bug 1509438 [wpt PR 14196] - [css-contain] Fix baseline for elements with contain: layout, a=testonly
Automatic update from web-platform-tests
[css-contain] Fix baseline for elements with contain: layout

Layout containment elements are treated as having no baseline,
when that's applied to table cells, flex or grid items
that are baseline aligned that means that they should use
their synthesized baseline.

The patch adds simple check in LayoutBlockFlow::FirstLineBoxBaseline()
similar to what we have in other methods. If the element has
layout containment it has no baseline (it returns -1).
The same thing is done in LayoutNGMixin<Base>::FragmentBaseline()
for LayoutNG.

Two tests from the WPT suite has been modified in order to avoid
baseline alignment as they are not checking that feature
of layout containment but something else.

BUG=907709
TEST=external/wpt/css/css-contain/contain-layout-baseline-002.html
TEST=external/wpt/css/css-contain/contain-layout-baseline-003.html
TEST=external/wpt/css/css-contain/contain-layout-baseline-004.html

Change-Id: Id393787dd24bf3e34aaf73476e446fb9d0a4e593
Reviewed-on: https://chromium-review.googlesource.com/c/1348892
Commit-Queue: Manuel Rego <rego@igalia.com>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610833}

--

wpt-commits: 3b78c96b77028a81550e43f3561c2c32d23358ab
wpt-pr: 14196
2018-12-11 15:49:49 +00:00

22 lines
525 B
HTML

<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Containment Test: Reference file</title>
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com">
<style>
div {
display: inline-block;
font: 100px/1 Ahem;
width: 100px;
height: 100px;
}
#first {
color: blue;
position: relative;
top: 20px;
}
#second {
color: green;
}
</style>
<p>Test passes if there is not a rectangle as the two boxes ("blue" and "green") are not baseline aligned.</p>
<div id="first">X</div><div id="second">X</div>