gecko-dev/testing/web-platform/tests/css/css-contain/contain-layout-independent-formatting-context-002.html
Manuel Rego Casasnovas c0c2a128f3 Bug 1491785 [wpt PR 13025] - [css-contain] Layout and size containment and baseline alignment, a=testonly
Automatic update from web-platform-tests[css-contain] Layout and size containment and baseline alignment

The CSSWG has recently resolved that layout containment
suppress baseline alignment, while size containment does not:
https://github.com/w3c/csswg-drafts/issues/2995

Spec text (https://drafts.csswg.org/css-contain/#containment-layout):
  "7. For the purpose of the vertical-align property,
   or any other property whose effects need to relate
   the position of the containing element's baseline
   to something other than its descendants,
   the containing element is treated as having no baseline."

And a note in (https://drafts.csswg.org/css-contain/#containment-size):
  "Note: size containment does not suppress baseline alignment.
   See layout containment for that."

The patch is just a modification in the condition at
LayoutBlock::UseLogicalBottomMarginEdgeForInlineBlockBaseline().

Some tests in the suite need minor modifications
due to the behavior change in order to match the references.

One of the Mozilla tests is failing now, a bug was reported
to get it updated (https://bugzilla.mozilla.org/1491235).

BUG=882333
TEST=external/wpt/css/css-contain/contain-layout-baseline-001.html
TEST=external/wpt/css/css-contain/contain-size-baseline-001.html

Change-Id: I08f157bfbc7477777b2f0b0157d8f05d3a6219d6
Reviewed-on: https://chromium-review.googlesource.com/1226146
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Commit-Queue: Manuel Rego <rego@igalia.com>
Cr-Commit-Position: refs/heads/master@{#591642}

--

wpt-commits: bec8a89a03674f5cf7a6aa8b7b23d196c377790f
wpt-pr: 13025


--HG--
rename : testing/web-platform/tests/css/css-contain/reference/contain-size-021-ref.html => testing/web-platform/tests/css/css-contain/reference/contain-size-025-ref.html
2018-09-20 12:09:16 +00:00

19 lines
948 B
HTML

<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Containment Test: Layout containment independent formatting context</title>
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com">
<link rel="help" href="https://drafts.csswg.org/css-contain-1/#containment-layout">
<link rel="match" href="reference/contain-paint-independent-formatting-context-001-ref.html">
<meta name=assert content="Layout containment elements establish an independent formatting context. The test checks that this feature of layout containment applies to inline blocks.">
<style>
.wrapper {
border: solid thick;
margin: 1em;
}
</style>
<p>Test passes if it has the same output than the reference.</p>
<div class="wrapper">
<span style="display: inline-block; margin: 1em 0; vertical-align: top; contain: layout;">
<div style="margin: 1em 0;">This text should have 2em top and bottom margins (margins do not collapse).</div>
</span>
</div>