-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rendering: further details/summary cleanup #4746
Conversation
It seems there is no WPT about this, just an internal Chromium test. See https://chromium-review.googlesource.com/c/chromium/src/+/1724676 |
@Loirooriol could you maybe turn that into a WPT test? |
@annevk That test uses internal Chromium APIs in order to access the flat tree, since the shadow tree is closed. I don't think I can do that in WPT. |
@Loirooriol I think you should be able to write a reftest for this, given the original bug report. |
Yes, but it seems suboptimal. If I use |
@Loirooriol interesting point, ideally that's not an implementation detail and we define what works here. #1839 is also about this a bit (though for cc @emilio |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks sensible. Did we decide on the pseudo-element story yet?
As is evident from https://bugs.chromium.org/p/chromium/issues/detail?id=973074 the current description still had too much from the old description and led to some inconsistencies in implementations. This makes it clear the slots have no special styling (by default) and it's the first summary element that is special, not the first slot.
af0f27e
to
8642f26
Compare
We're supportive of this change. I can take care of implementation on Chromium, and adding a WPT test. My plan (subject to comments here) would be to use the test case (converted to a reftest) provided by Igalia in this comment on the Chromium bug: <div style="display: grid; grid-template-columns: auto auto;">
<details style="display: contents;" open>
<summary style="background: magenta; grid-column: 1 / 3;">foo</summary>
<div style="background: cyan; grid-column: 1 / 3;">bar</div>
</details>
</div> |
This seems safer now with the resolution from w3c/csswg-drafts#4065:
Therefore, in <details style="display: grid" open>
<summary style="display: inline">foo</summary>
<div style="display: inline">bar</span>
</details> both the And same for the following, even if the <div style="display: grid">
<details style="display: contents" open>
<summary style="display: inline">foo</summary>
<div style="display: inline">bar</span>
</details>
</div> @mfreed7 The implementation should be simple, https://chromium-review.googlesource.com/c/chromium/src/+/1724676. |
Thanks! I didn't know you already had a patch up - would have saved me the time of doing the same thing. Anyway, as you point out, relatively simple fix. Thanks for all the help here. |
Previously, there was an anonymous <div> in the shadow dom for the <summary> element, which caused display:contents to not behave in an interoperable way. See [1] for a spec PR that clarifies the spec, and this CL matches the new clarification. The new WPT added here passes already on Gecko and WebKit. [1] whatwg/html#4746 Fixed: 973074 Change-Id: Iba54616c4e54e357dd71b7de30de18bde8ff3983
Previously, there was an anonymous <div> in the shadow dom for the <summary> element, which caused display:contents to not behave in an interoperable way. See [1] for a spec PR that clarifies the spec, and this CL matches the new clarification. The new WPT added here passes already on Gecko and WebKit. [1] whatwg/html#4746 Fixed: 973074 Change-Id: Iba54616c4e54e357dd71b7de30de18bde8ff3983
Previously, there was an anonymous <div> in the shadow dom for the <summary> element, which caused display:contents to not behave in an interoperable way. See [1] for a spec PR that clarifies the spec, and this CL matches the new clarification. The new WPT added here passes already on Gecko and WebKit. [1] whatwg/html#4746 Fixed: 973074 Change-Id: Iba54616c4e54e357dd71b7de30de18bde8ff3983 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2462217 Commit-Queue: Mason Freed <masonfreed@chromium.org> Reviewed-by: Oriol Brufau <obrufau@igalia.com> Auto-Submit: Mason Freed <masonfreed@chromium.org> Cr-Commit-Position: refs/heads/master@{#815731}
Previously, there was an anonymous <div> in the shadow dom for the <summary> element, which caused display:contents to not behave in an interoperable way. See [1] for a spec PR that clarifies the spec, and this CL matches the new clarification. The new WPT added here passes already on Gecko and WebKit. [1] whatwg/html#4746 Fixed: 973074 Change-Id: Iba54616c4e54e357dd71b7de30de18bde8ff3983 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2462217 Commit-Queue: Mason Freed <masonfreed@chromium.org> Reviewed-by: Oriol Brufau <obrufau@igalia.com> Auto-Submit: Mason Freed <masonfreed@chromium.org> Cr-Commit-Position: refs/heads/master@{#815731}
Previously, there was an anonymous <div> in the shadow dom for the <summary> element, which caused display:contents to not behave in an interoperable way. See [1] for a spec PR that clarifies the spec, and this CL matches the new clarification. The new WPT added here passes already on Gecko and WebKit. [1] whatwg/html#4746 Fixed: 973074 Change-Id: Iba54616c4e54e357dd71b7de30de18bde8ff3983 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2462217 Commit-Queue: Mason Freed <masonfreed@chromium.org> Reviewed-by: Oriol Brufau <obrufau@igalia.com> Auto-Submit: Mason Freed <masonfreed@chromium.org> Cr-Commit-Position: refs/heads/master@{#815731}
Alright, this is now implemented in Chromium, and tests added here. |
Safari passes the test so I didn't file a bug there. However, Firefox also passes the test and @emilio has landed the fix yet... |
The test checks that no wrapper element is added (which is what Chromium was doing). For Firefox the problem is that it's using custom layout instead of shadow DOM. So Firefox will need a different test, like using |
…y shadow dom, a=testonly Automatic update from web-platform-tests Remove anonymous box from details/summary shadow dom Previously, there was an anonymous <div> in the shadow dom for the <summary> element, which caused display:contents to not behave in an interoperable way. See [1] for a spec PR that clarifies the spec, and this CL matches the new clarification. The new WPT added here passes already on Gecko and WebKit. [1] whatwg/html#4746 Fixed: 973074 Change-Id: Iba54616c4e54e357dd71b7de30de18bde8ff3983 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2462217 Commit-Queue: Mason Freed <masonfreed@chromium.org> Reviewed-by: Oriol Brufau <obrufau@igalia.com> Auto-Submit: Mason Freed <masonfreed@chromium.org> Cr-Commit-Position: refs/heads/master@{#815731} -- wpt-commits: 411d1bfc11c5779664101d938b290e0dd26d812d wpt-pr: 26053
…y shadow dom, a=testonly Automatic update from web-platform-tests Remove anonymous box from details/summary shadow dom Previously, there was an anonymous <div> in the shadow dom for the <summary> element, which caused display:contents to not behave in an interoperable way. See [1] for a spec PR that clarifies the spec, and this CL matches the new clarification. The new WPT added here passes already on Gecko and WebKit. [1] whatwg/html#4746 Fixed: 973074 Change-Id: Iba54616c4e54e357dd71b7de30de18bde8ff3983 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2462217 Commit-Queue: Mason Freed <masonfreed@chromium.org> Reviewed-by: Oriol Brufau <obrufau@igalia.com> Auto-Submit: Mason Freed <masonfreed@chromium.org> Cr-Commit-Position: refs/heads/master@{#815731} -- wpt-commits: 411d1bfc11c5779664101d938b290e0dd26d812d wpt-pr: 26053
Previously, there was an anonymous <div> in the shadow dom for the <summary> element, which caused display:contents to not behave in an interoperable way. See [1] for a spec PR that clarifies the spec, and this CL matches the new clarification. The new WPT added here passes already on Gecko and WebKit. [1] whatwg/html#4746 Fixed: 973074 Change-Id: Iba54616c4e54e357dd71b7de30de18bde8ff3983 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2462217 Commit-Queue: Mason Freed <masonfreed@chromium.org> Reviewed-by: Oriol Brufau <obrufau@igalia.com> Auto-Submit: Mason Freed <masonfreed@chromium.org> Cr-Commit-Position: refs/heads/master@{#815731} GitOrigin-RevId: 57f68063f26a1015f6acc649e14135e75eca55a2
As is evident from https://bugs.chromium.org/p/chromium/issues/detail?id=973074 the current description still had too much from the old description and led to some inconsistencies in implementations. This makes it clear the slots have no special styling (by default) and it's the first summary element that is special, not the first slot.
(See WHATWG Working Mode: Changes for more details.)
/rendering.html ( diff )