Re: empty lists in older HTML versions- was: Re: role="list", Safari and VoiceOver

Of course you’re right, Christoph. Thanks for making this clear.

Lesson learned: Instead of writing „if I’m not wrong“: RTFM! 

--

Mit freundlichen Grüßen

Marc Haunschild

> Am 03.05.2022 um 12:49 schrieb Christophe Strobbe <strobbe@hdm-stuttgart.de>:
> 
> Hi Marc, 
> 
>> On 03 May 2022 at 08:49 Marc Haunschild <haunschild@mhis.onmicrosoft.de> wrote: (...) 
>> 
>> In earlier versions of html (if I’m not wrong) a list was even allowed to be completely empty, which makes sense to me. For example a shopping list - it's there, even if your fridge is full. And when the milk is out and you put it on that list, it has just one list item until you add butter or cheese.
> Let me be the nasty fact-checker here ;-)
> 
> HTML 4.01, HTML 3.2 and HTML 2.0 all required at least one LI element inside OL or UL:
> 
> From the HTML 4.01 DTD (the plus sign means "at least one"): 
> 
> <!ELEMENT UL - - (LI)+ -- unordered list -->
> <!ELEMENT OL - - (LI)+ -- ordered list --> 
> (See https://www.w3.org/TR/html401/struct/lists.html#edef-UL )
> 
> From HTML 3.2: 
> 
> <!ELEMENT UL - - (LI)+>
> <!ELEMENT OL - - (LI)+>
> 
> (See https://www.w3.org/TR/2018/SPSD-html32-20180315/#lists <https://www.w3.org/TR/2018/SPSD-html32-20180315/#lists> ) 
> 
> From the HTML 2 DTD: 
> 
> <!ELEMENT (OL|UL) - - (LI)+>
> 
> (See https://www.w3.org/MarkUp/html-spec/html.dtd <https://www.w3.org/MarkUp/html-spec/html.dtd> ) 
> 
> The same content model was also used in XHTML 1.0; see https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd <https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd> 
> 
> The only HTML spec that allows "Zero or more li and script-supporting elements", rather than at least one LI element, is HTML 5: https://html.spec.whatwg.org/multipage/grouping-content.html#the-ol-element <https://html.spec.whatwg.org/multipage/grouping-content.html#the-ol-element> (And the HTML5 validator considers empty ul and ol elements as valid.) 
> However, I wrote this message under the assumption that you meant HTML versions before HTML 5. 
> 
> Best regards, 
> 
> Christophe Strobbe 
> 
>  

Received on Tuesday, 3 May 2022 12:24:13 UTC