These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:21 pm Advanced search

Dialog tag: Why do nested list tags stay open?

Here you can discuss things related to HTML and the Web in general that do not fit in to other categories.

Dialog tag: Why do nested list tags stay open?

Postby wgabrie » Wed Apr 18, 2007 5:16 pm

Why do nested list tags stay open in the Dialog tag example?

Web Applications 1.0
This example demonstrates this using an extract from Abbot and Costello's famous sketch, Who's on first:
<dialog>
<dt>Costello
<dd> Look, you gotta first baseman?
<dt> Abbott
<dd> Certainly.
<dt> Costello
<dd> Who's playing first?
<dt> Abbott
<dd> That's right.
<dt> Costello
<dd> When you pay off the first baseman every month, who gets the money?
<dt> Abbott
<dd> Every dollar of it.
</dialog>
wgabrie
<h4>
 
Posts: 25
Joined: Thu Apr 05, 2007 8:55 pm

Use end tags to close the dialog element.

Postby wgabrie » Wed Apr 18, 2007 9:40 pm

The dialog tag is a block level element and this can be set using CSS:
Code: Select all
dialog {display:block;}


I tested Dialog with other content. The content that comes after the dialog block is formated as part of the definition. You cannot stop the list by putting it in a block-level element.

Using the dt and dd tags is a good idea. Just close them unless you want a nightmare. Conclusion: Always use end tags.
wgabrie
<h4>
 
Posts: 25
Joined: Thu Apr 05, 2007 8:55 pm

Re: Use end tags to close the dialog element.

Postby zcorpan » Thu Apr 19, 2007 12:17 am

wgabrie wrote:Why do nested list tags stay open in the Dialog tag example?
To reveal browser bugs? :) Or perhaps because it's allowed and makes the source code less verbose, or is just easier to type?
wgabrie wrote:The dialog tag is a block level element and this can be set using CSS:
Code: Select all
dialog {display:block;}
Just to be clear: <dialog> is a block-level element in HTML regardless of CSS 'display'.

wgabrie wrote:I tested Dialog with other content. The content that comes after the dialog block is formated as part of the definition. You cannot stop the list by putting it in a block-level element.
Test case:
Code: Select all
<!doctype html>
<title>Unclosed &lt;dd> in &lt;dialog></title>
<style>
p { background:lime; }
dialog p { background:red; }
</style>
<dialog>
<dd>
</dialog>
<p>This line should have a green background.
The line is green in IE, Firefox and Safari, but red in Opera. So you have found a parsing bug in Opera. :) I've reported it (#261248). Cheers.
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Re: Use end tags to close the dialog element.

Postby zcorpan » Fri Apr 20, 2007 2:08 pm

zcorpan wrote: So you have found a parsing bug in Opera. :)
Or perhaps not... :roll:
annevk wrote:I think this bug report is invalid. When you hit </foo> <dd> is the bottommost node of the stack. <dd> is in neither the formatting nor phrasing category (it's in special) and therefore the </foo> end tag is ignored.

So the parsing section just has to add support for <dialog>. Meanwhile you can use </dd> before </dialog>.
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Postby wgabrie » Mon Apr 23, 2007 8:37 pm

This bug has given me an idea for another technique. This would be really awesome with a screen reader!

Code: Select all
<dialog>
<dt style="pause:1s;">[Begin dialog]</dt>
<dd>

...

<p style="pause:1s;">[End dialog]</p>
</dd></dialog>
wgabrie
<h4>
 
Posts: 25
Joined: Thu Apr 05, 2007 8:55 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest