Allow <div> around each <dt><dd> group in <dl>#1945
Conversation
This only changes the content model and the rules for determining what a dl element represents. Fixes #1937.
| @@ -17960,6 +17991,7 @@ first matching case):</p> | |||
| <dd>None.</dd> | |||
There was a problem hiding this comment.
Does div need its "contexts in which this element can be used" updated?
| <dd>If the element is not a child of a <code>dl</code> element: <span>Flow content</span>.</dd> | ||
| <dt><span data-x="concept-element-attributes">Content attributes</span>:</dt> | ||
| <dd><span>Global attributes</span></dd> | ||
| <dt><span data-x="concept-element-dom">DOM interface</span>:</dt><!--TOPIC:DOM APIs--> |
There was a problem hiding this comment.
Should we update the short paragraph describing the div element, and the note describing it as an element of last resort?
There was a problem hiding this comment.
I updated the description, but not the note. I don't want to tweak div itself so much in this PR, that seems like a separate issue.
|
I guess we should also put updating the FAQ as an action item after this is merged :) |
Also mention dl in the div section. Also mention div in dl's description of the name-value groups.
source
Outdated
|
|
||
| <p>If a <code>dl</code> element has no <code>dt</code> or <code>dd</code> element children, it | ||
| contains no groups.</p> | ||
| <p>If a <code>dl</code> element has no <code>dt</code> or <code>dd</code> element children, or if |
There was a problem hiding this comment.
I'm thinking of replacing these paragraphs with an algorithm for how to get the groups of a dl element, since right now they are probably a bit confusing and not so helpful if someone wants to actually get the groups of a dl element (in an HTML scraping tool for example).
My thinking is that the algorithm should be something like this:
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4601
This should be editorial. Hopefully clearer and more helpful.
See whatwg/html#1945 This passes the tests in web-platform-tests/wpt#4053 Note that `<dl><script></script></dl>` previously resulted in an error; now has no errors.
source
Outdated
| <div itemscope itemtype="http://schema.org/Product"> | ||
| <dt itemprop="name">Café ou Chocolat Liégeois</dt> | ||
| <dd itemprop="offers" itemscope itemtype="http://schema.org/Offer"> | ||
| <span itemprop="price">3.50 €</span> |
There was a problem hiding this comment.
Use the priceCurrency property (with ISO 4217 codes e.g. "USD") instead of including ambiguous symbols such as '$' in the value.
Also remove `div` from the supposedly-divless example.
See whatwg/html#1945 This passes the tests in web-platform-tests/wpt#4053 Note that `<dl><script></script></dl>` previously resulted in an error; now has no errors.
|
Why would you want to allow |
|
@gunnarbittersmann I suggest you read through #1937. Lots of alternatives were considered. |
|
According to the HTML5.org’s Nu Html Checker, looks like we still cannot use multiple nested If this is intentional (hopefully not), this is a huge limitation that makes the feature much less useful. |
|
It's intentional, see #1937 (comment) |
|
@zcorpan Thanks, Simon. That’s a real shame. I was intending to adopt the feature, but now I’m forced to switch back to the previously used Could you explain why exactly in practice (besides just an intent to make the content model as strict and simple as possible) using more than one I believe there is nothing that makes this: less possible than this: (Please let me know if it’s more appropriate to discussing this in the thread you’ve referred to). |
|
I was not aware of use cases that required multiple nested elements (I don't recall it being stated as a requirement in #1937), and so went with the strict and simple approach. Why do you need multiple elements? Can you point to something where you currently use Allowing arbitrary nested |
I use
Complicating conformance checkers is probably a minor thing. And actually, complication is obviously quite little.
Quite the contrary, it was always possible to nest multiple
Given that |
This only changes the content model and the rules for determining what a dl element represents. Fixes whatwg#1937.
This only changes the content model and the rules for determining
what a dl element represents.
Fixes #1937.