Bug 18691 - <legend> element is dropped on the floor
Summary: <legend> element is dropped on the floor
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh OS X 10.5
: P2 Normal
Assignee: Nobody
URL: http://software.hixie.ch/utilities/js...
Keywords:
: 19634 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-04-22 22:45 PDT by Ian 'Hixie' Hickson
Modified: 2011-05-24 21:17 PDT (History)
8 users (show)

See Also:


Attachments
Proposed "fix": Land the test case (989 bytes, patch)
2011-05-23 18:26 PDT, Julien Chaffraix
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ian 'Hixie' Hickson 2008-04-22 22:45:56 PDT
STEPS TO REPRODUCE:
 1. parse data:text/html,<legend>test</legend>
 2. examine the DOM

EXPECTED RESULTS
 <html><head></head><body><legend>test</legend></body></html>

ACTUAL RESULTS
 There's no <legend> there!

Could we make the <legend> element parse like any unknown element, instead of dropping it on the floor if it is found outside a <fieldset>?

See also:
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E...%3Clegend%3E...%3C%2Flegend%3E

If we can resolved this relatively soon (like a Safari 3 point release) that would be cool. If we can't get browsers to fix this, then we're going to have to introduce a new element for <figure>'s caption, which would be a pain.

As far as I know, other browsers don't have this behaviour with <legend>.
Comment 1 Robert Blaut 2008-07-16 02:34:55 PDT
*** Bug 19634 has been marked as a duplicate of this bug. ***
Comment 2 Robert Blaut 2008-07-16 03:26:52 PDT
I think it's worth to notice that Firefox incorrectly creates fieldset in this case. The issue is tracked by bug https://bugzilla.mozilla.org/show_bug.cgi?id=430416
Comment 3 Julien Chaffraix 2011-05-23 12:47:36 PDT
I tried to reproduce this bug but we now properly generate <legend> tags. My guess is that the HTML5 tokenizing / parsing refactoring solved it.

Our HTML5lib tests don't seem to cover this so taking the bug to land the now passing test case.
Comment 4 Julien Chaffraix 2011-05-23 18:26:08 PDT
Created attachment 94534 [details]
Proposed "fix": Land the test case
Comment 5 Hajime Morrita 2011-05-24 20:38:14 PDT
Comment on attachment 94534 [details]
Proposed "fix": Land the test case

Looks fine.
Comment 6 WebKit Commit Bot 2011-05-24 21:16:00 PDT
The commit-queue encountered the following flaky tests while processing attachment 94534 [details]:

http/tests/websocket/tests/handshake-error.html bug 53851 (author: abarth@webkit.org)
The commit-queue is continuing to process your patch.
Comment 7 WebKit Commit Bot 2011-05-24 21:17:13 PDT
Comment on attachment 94534 [details]
Proposed "fix": Land the test case

Clearing flags on attachment: 94534

Committed r87265: <http://trac.webkit.org/changeset/87265>
Comment 8 WebKit Commit Bot 2011-05-24 21:17:18 PDT
All reviewed patches have been landed.  Closing bug.