Skip to content

Commit

Permalink
Add test asserting the display property of <details> is ignored
Browse files Browse the repository at this point in the history
Chrome, Safari, and Firefox pass. Edge hasn't implemented yet.

The test still holds for the proposed new spec text in
whatwg/html#3686

This scenario is discussed at the end of
whatwg/html#603 but the conclusion drawn
appears (to me) to be opposite what Chrome, Safari, and Firefox do.

Related other issues:
w3c/csswg-drafts#2084
whatwg/html#1839

Bug: 635282
Change-Id: Ice95225b3c9d5d90b80c657643d036490fd2e1b2
  • Loading branch information
davidsgrogan authored and Chrome-bot committed Aug 3, 2018
1 parent 1d73b48 commit e9f418f
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="author" title="David Grogan" href="dgrogan@chromium.org">
From <a href="https://html.spec.whatwg.org/multipage/rendering.html#the-details-and-summary-elements">html.spec.whatwg.org</a>:

<blockquote>
The details element is expected to render as a block box. The element's shadow
tree is expected to take the element's first summary element child, if any, and
place it in a first block box container, and then take the element's remaining
descendants, if any, and place them in a second block box container.
</blockquote>

&lt;details display:flex> should be ignored. Otherwise details would render as
something other than a block box.

<details open>
<summary>This is the summary.</summary>
<div>thing 1</div>
thing 2
</details>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="author" title="David Grogan" href="dgrogan@chromium.org">
<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#the-details-and-summary-elements">
<link rel="match" href="details-display-property-is-ignored-ref.html">
<link rel="bookmark" href="https://bugs.chromium.org/p/chromium/issues/detail?id=635282" />
<meta name="assert" content="The display property is ignored on details elements and is instead always rendered as a block box." />

From <a href="https://html.spec.whatwg.org/multipage/rendering.html#the-details-and-summary-elements">html.spec.whatwg.org</a>:

<blockquote>
The details element is expected to render as a block box. The element's shadow
tree is expected to take the element's first summary element child, if any, and
place it in a first block box container, and then take the element's remaining
descendants, if any, and place them in a second block box container.
</blockquote>

&lt;details display:flex> should be ignored. Otherwise details would render as
something other than a block box.

<details open style="display:flex;">
<summary>This is the summary.</summary>
<div>thing 1</div>
thing 2
</details>

0 comments on commit e9f418f

Please sign in to comment.