✨ Recognize details element with open/[open] attributes and summary child element#18440
Conversation
honeybadgerdontcare
left a comment
There was a problem hiding this comment.
Validation feedback only.
validator/validator-main.protoascii
Outdated
| } | ||
| } | ||
| # 4.4.8 The dl element | ||
| # 4.11.1 (HTML5.3) The details element |
There was a problem hiding this comment.
It seems with 5.3 they've renumbered everything so this doesn't really follow our existing numbering. I'd still recommend putting it just before 4.11 Scripting below and include a 4.11 Interactive elements before it.
validator/validator-main.protoascii
Outdated
| # 4.11.1 (HTML5.3) The details element | ||
| tags: { | ||
| html_format: AMP | ||
| html_format: AMP4ADS |
There was a problem hiding this comment.
Lets begin with just AMP and leave the other formats for future PRs. If you believe these should be added to other formats then I'd recommend opening an issue asking for feedback from others as each one of these formats have a different spec. Same for below for SUMMARY.
There was a problem hiding this comment.
EXPERIMENTAL would also be removed?
validator/validator-main.protoascii
Outdated
| tag_name: "SUMMARY" | ||
| mandatory_parent: "DETAILS" | ||
| } | ||
| # 4.4.9 The dl element |
There was a problem hiding this comment.
Please leave as 4.4.8 as these are following the HTML5 spec.
|
@dvoytenko for including HTML5.3 spec items |
|
The element itself LG. We won't be providing any polyfills, will we? |
Also limit html_format to just AMP.
|
Why are the tests failing? Do I need to rebuild something and commit? |
|
The test failure mentions that the tag name is not defined. And it is not defined for summary. |
@dvoytenko That's a good question. In terms of the actual clicking of the I think the styling of the element should be left to the author, however. |
|
On second thought, I wonder if Likewise, if you opened the Since the state can easily get out of sync, it seems the Thoughts? |
|
What about the question regarding whether the |
|
Re [open], I don't really have an opinion. Adding @choumx who might. |
|
LGTM once the amp-bind question is resolved. |
|
Either way is fine by me. I think amp-accordion has a similar issue and it's not a dealbreaker IMO. |
|
OK, cool. Let's keep To deal with the inconsistent state issue, it would be great to introduce a way to connect a bound attribute with some state in a more declarative way so that updates to the attribute and to the state so that there could be two-way binding. |
|
@Gregable I believe the question is resolved. |
|
Anything left here to do? |
honeybadgerdontcare
left a comment
There was a problem hiding this comment.
validation changes look good
* cl/225092847 Add validator rules for amp-video and amp-yotpo in EXPERIMENTAL. * cl/225106151 "add validator changes to support script templates -alabiaga@" * cl/225388113 Revision bump for #19854 * cl/225400099 Revision bump for #19871 * cl/225612473 Remove EXPERIMENTAL from amp-list and amp-state. * cl/225861155 Revision bump for #19872 * cl/225872246 Revision bump for #19894 * cl/225876987 Revision bump for #18700 * cl/226048698 Revision bump for #19928 * cl/226051527 Revision bump for #18440
…hild element (ampproject#18440) * Add details element with open boolean attr and summary child element * Add details@open attribute to amp-bind * Add Interative elements section with details and summary elements Also limit html_format to just AMP. * Add missing tag_name for summary element * Fix order of summary tag properties * Add amp-bind example for details element * Include details/summary elements in AMP4ADS, AMP4EMAIL, EXPERIMENTAL
* cl/225092847 Add validator rules for amp-video and amp-yotpo in EXPERIMENTAL. * cl/225106151 "add validator changes to support script templates -alabiaga@" * cl/225388113 Revision bump for ampproject#19854 * cl/225400099 Revision bump for ampproject#19871 * cl/225612473 Remove EXPERIMENTAL from amp-list and amp-state. * cl/225861155 Revision bump for ampproject#19872 * cl/225872246 Revision bump for ampproject#19894 * cl/225876987 Revision bump for ampproject#18700 * cl/226048698 Revision bump for ampproject#19928 * cl/226051527 Revision bump for ampproject#18440
…hild element (ampproject#18440) * Add details element with open boolean attr and summary child element * Add details@open attribute to amp-bind * Add Interative elements section with details and summary elements Also limit html_format to just AMP. * Add missing tag_name for summary element * Fix order of summary tag properties * Add amp-bind example for details element * Include details/summary elements in AMP4ADS, AMP4EMAIL, EXPERIMENTAL
* cl/225092847 Add validator rules for amp-video and amp-yotpo in EXPERIMENTAL. * cl/225106151 "add validator changes to support script templates -alabiaga@" * cl/225388113 Revision bump for ampproject#19854 * cl/225400099 Revision bump for ampproject#19871 * cl/225612473 Remove EXPERIMENTAL from amp-list and amp-state. * cl/225861155 Revision bump for ampproject#19872 * cl/225872246 Revision bump for ampproject#19894 * cl/225876987 Revision bump for ampproject#18700 * cl/226048698 Revision bump for ampproject#19928 * cl/226051527 Revision bump for ampproject#18440


I couldn't find a clear explanation on why the HTML5
detailselement is not allowed. The only mention of it is #1410 in relation toamp-accordion. It would be helpful to supportdetailswhen converting HTML into AMP (such as in the WordPress plugin), since it could be used as-is without having to try to port it over toamp-accordion(even though the latter is more powerful), as adetails-to-amp-accordionconversion so would would cause complications with existing styles that target thedetailselement and its children.In this PR:
detailselement.detailselement'sopenboolean attribute.[open]toamp-bindfor managing the thedetailselement'sopenboolean attribute.summaryelement as a child ofdetails.With these changes in place, an AMP document would be able to do: