gecko-dev/testing/web-platform/tests/css/css-contain/contain-layout-006.html
Manuel Rego Casasnovas 39eb5fa53f Bug 1461945 [wpt PR 11026] - [css-contain] Layout containment abspos and fixed descendants, a=testonly
Automatic update from web-platform-tests[css-contain] Layout containment abspos and fixed descendants

An element with "contain: layout" should be the containing block
of any absolutely or fixed positioned descendants.

The spec is very clear regarding this
(https://drafts.csswg.org/css-contain/#containment-layout):
"The element acts as a containing block for absolutely positioned
 and fixed positioned descendants."

The patch just adds a new condition to
ComputedStyle::CanContainFixedPositionObjects().

We already had the condition for paint containment before,
so this takes advantage to add WPT tests to verify that case too.

This patch causes that contain-layout-005.html starts to fail,
but that's because of crbug.com/843329.
There are more failing tests related to that bug, so TestExpectations
is modified to reference it.

BUG=785212
TEST=external/wpt/css/css-contain/contain-layout-006.html
TEST=external/wpt/css/css-contain/contain-layout-007.html

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

--

wpt-commits: 90f40cbe8452a84496c3e83bbba5b1de3f26455f
wpt-pr: 11026
2018-05-20 19:18:14 +00:00

28 lines
861 B
HTML

<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Containment Test: Layout containment absolutely positioned descendants</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/ref-filled-green-100px-square.xht">
<meta name=assert content="Layout containment makes an element to act as containing block for absolutely positioned descendants.">
<style>
#contain-layout {
contain: layout;
width: 100px;
height: 100px;
background: red;
}
#abspos {
position: absolute;
bottom: 0;
right: 0;
background: green;
width: 100px;
height: 100px;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="contain-layout">
<div id="abspos"></div>
</div>