Bug 1351339: Test. r=heycam
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 08 May 2017 03:41:00 +0200
changeset 357012 d4de1e480c2e5a00a93f25469676bd19d9a353f2
parent 357011 558c843afbd35b6a15d3dbe397048bf0e772f779
child 357013 0e874f047cc8ca8b45a9b5436652f093d046aae4
push id42207
push userecoal95@gmail.com
push dateMon, 08 May 2017 11:47:08 +0000
treeherderautoland@d4de1e480c2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1351339
milestone55.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 1351339: Test. r=heycam Written in a kind-of creative way, but I plan to upstream it to WPT, so this is the best way I found to do it. MozReview-Commit-ID: 3GBeZk3uq11
layout/reftests/css-display/display-contents-state-change-ref.html
layout/reftests/css-display/display-contents-state-change.html
layout/reftests/css-display/reftest.list
new file mode 100644
--- /dev/null
+++ b/layout/reftests/css-display/display-contents-state-change-ref.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS test reference</title>
+<link rel="author" name="Emilio Cobos Álvarez" href="mailto:ecobos@igalia.com">
+<style>
+div {
+  color: green;
+}
+</style>
+<div>
+  This text should be green, there should be no red border at any time.
+</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/css-display/display-contents-state-change.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS display: State changes are handled correctly for display: contents children</title>
+<link rel="help" href="https://drafts.csswg.org/css-display-3/#valdef-display-contents">
+<link rel="author" name="Emilio Cobos Álvarez" href="mailto:ecobos@igalia.com">
+<link rel="match" href="display-contents-state-change-ref.html">
+<style>
+:focus-within .contents {
+  color: green;
+}
+.contents {
+  display: contents;
+  border: 10px solid red;
+  color: red;
+}
+input {
+  position: absolute;
+  left: -9999px;
+  top: -9999px;
+}
+</style>
+<div>
+  <input type="text">
+  <div class="contents">This text should be green, there should be no red border at any time.</div>
+</div>
+<script>
+onload = function() {
+  document.querySelector('input').focus();
+}
+</script>
--- a/layout/reftests/css-display/reftest.list
+++ b/layout/reftests/css-display/reftest.list
@@ -22,10 +22,11 @@ fuzzy-if(Android,7,1186) pref(dom.webcom
 asserts(1) asserts-if(stylo,2) == display-contents-xbl-3.xul display-contents-xbl-3-ref.xul # bug 1089223
 skip == display-contents-xbl-4.xul display-contents-xbl-4-ref.xul # fails (not just asserts) due to bug 1089223
 asserts(0-1) fuzzy-if(Android,8,3216) == display-contents-fieldset.html display-contents-fieldset-ref.html # bug 1089223
 asserts(1) asserts-if(stylo,2) == display-contents-xbl-5.xul display-contents-xbl-3-ref.xul # bug 1089223
 == display-contents-list-item-child.html display-contents-list-item-child-ref.html
 == display-contents-dyn-insert-text.html display-contents-dyn-insert-text-ref.html
 == display-contents-writing-mode-1.html display-contents-writing-mode-1-ref.html
 == display-contents-writing-mode-2.html display-contents-writing-mode-2-ref.html
+needs-focus == display-contents-state-change.html display-contents-state-change-ref.html
 pref(layout.css.display-flow-root.enabled,true) == display-flow-root-001.html display-flow-root-001-ref.html
 pref(layout.css.display-flow-root.enabled,false) fails-if(stylo) == display-flow-root-001.html display-flow-root-disabled-001-ref.html