Bug 1461945 [wpt PR 11026] - [css-contain] Layout containment abspos and fixed descendants, a=testonly
authorManuel Rego Casasnovas <rego@igalia.com>
Sat, 19 May 2018 20:28:46 +0000
changeset 419078 0c68905b3d04284bbde904ac9cb944801a4e55b2
parent 419077 4a5ab590207da99b47f5ed43e9c1d4e3a0445234
child 419079 5496e27bf28dd0950e47b1896bebb3b790a4eb6b
push id34026
push userapavel@mozilla.com
push dateMon, 21 May 2018 09:47:33 +0000
treeherdermozilla-central@dc1868d255be [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1461945, 11026, 843329, 785212, 1059557, 559045
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/css/css-contain/contain-layout-006.html
testing/web-platform/tests/css/css-contain/contain-layout-007.html
testing/web-platform/tests/css/css-contain/contain-paint-009.html
testing/web-platform/tests/css/css-contain/contain-paint-010.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -106802,16 +106802,40 @@
       [
        "/css/css-contain/reference/contain-layout-005-ref.html",
        "=="
       ]
      ],
      {}
     ]
    ],
+   "css/css-contain/contain-layout-006.html": [
+    [
+     "/css/css-contain/contain-layout-006.html",
+     [
+      [
+       "/css/reference/ref-filled-green-100px-square.xht",
+       "=="
+      ]
+     ],
+     {}
+    ]
+   ],
+   "css/css-contain/contain-layout-007.html": [
+    [
+     "/css/css-contain/contain-layout-007.html",
+     [
+      [
+       "/css/reference/ref-filled-green-100px-square.xht",
+       "=="
+      ]
+     ],
+     {}
+    ]
+   ],
    "css/css-contain/contain-layout-breaks-001.html": [
     [
      "/css/css-contain/contain-layout-breaks-001.html",
      [
       [
        "/css/css-contain/reference/contain-style-breaks-004-ref.html",
        "=="
       ]
@@ -106922,16 +106946,40 @@
       [
        "/css/css-contain/reference/contain-paint-008-ref.html",
        "=="
       ]
      ],
      {}
     ]
    ],
+   "css/css-contain/contain-paint-009.html": [
+    [
+     "/css/css-contain/contain-paint-009.html",
+     [
+      [
+       "/css/reference/ref-filled-green-100px-square.xht",
+       "=="
+      ]
+     ],
+     {}
+    ]
+   ],
+   "css/css-contain/contain-paint-010.html": [
+    [
+     "/css/css-contain/contain-paint-010.html",
+     [
+      [
+       "/css/reference/ref-filled-green-100px-square.xht",
+       "=="
+      ]
+     ],
+     {}
+    ]
+   ],
    "css/css-contain/contain-size-001.html": [
     [
      "/css/css-contain/contain-size-001.html",
      [
       [
        "/css/css-contain/reference/contain-size-001-ref.html",
        "=="
       ]
@@ -496206,16 +496254,24 @@
   "css/css-contain/contain-layout-004.html": [
    "dea2a6b1dada9e57f36d2245ac67c05fd9c4ad0b",
    "reftest"
   ],
   "css/css-contain/contain-layout-005.html": [
    "60b834ef7b5becf76f5cacd55b2b9c4774562637",
    "reftest"
   ],
+  "css/css-contain/contain-layout-006.html": [
+   "89c68e7ce325295d6a36da91b6d4dd39580f7165",
+   "reftest"
+  ],
+  "css/css-contain/contain-layout-007.html": [
+   "799965dfb9989fc3a8226e80fa3c67cafb24374b",
+   "reftest"
+  ],
   "css/css-contain/contain-layout-breaks-001.html": [
    "09fcfd311126800c7ce63f27c3154ef31fc647bd",
    "reftest"
   ],
   "css/css-contain/contain-layout-breaks-002.html": [
    "985252e8226e0cba567b49f44665804e3a12bc40",
    "reftest"
   ],
@@ -496246,16 +496302,24 @@
   "css/css-contain/contain-paint-007.html": [
    "3e7d3cd3ccb55b7b8574be24fb2f180a6ce0af36",
    "reftest"
   ],
   "css/css-contain/contain-paint-008.html": [
    "5540aaf33b5b841d95f84ead3459f634cf444299",
    "reftest"
   ],
+  "css/css-contain/contain-paint-009.html": [
+   "b3a8ee7512f1f893b630453a8443edaed983f4c3",
+   "reftest"
+  ],
+  "css/css-contain/contain-paint-010.html": [
+   "e47f99a8fedb60f34ec7877686f478cbc002c6b4",
+   "reftest"
+  ],
   "css/css-contain/contain-size-001.html": [
    "089c4fd7352f91a85d5d8f6bf8c5f261c868cd37",
    "reftest"
   ],
   "css/css-contain/contain-size-002.html": [
    "ea16d90e56729c1678b327412cd945a0dea6b762",
    "reftest"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-contain/contain-layout-006.html
@@ -0,0 +1,28 @@
+<!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>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-contain/contain-layout-007.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Containment Test: Layout containment fixed 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 fixed positioned descendants.">
+<style>
+#contain-layout {
+  contain: layout;
+  width: 100px;
+  height: 100px;
+  background: red;
+}
+
+#fixed {
+  position: fixed;
+  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="fixed"></div>
+</div>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-contain/contain-paint-009.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Containment Test: Paint 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-paint">
+<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
+<meta name=assert content="Paint containment makes an element to act as containing block for absolutely positioned descendants.">
+<style>
+#contain-paint {
+  contain: paint;
+  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-paint">
+  <div id="abspos"></div>
+</div>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-contain/contain-paint-010.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Containment Test: Paint containment fixed 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-paint">
+<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
+<meta name=assert content="Paint containment makes an element to act as containing block for fixed positioned descendants.">
+<style>
+#contain-paint {
+  contain: paint;
+  width: 100px;
+  height: 100px;
+  background: red;
+}
+
+#fixed {
+  position: fixed;
+  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-paint">
+  <div id="fixed"></div>
+</div>