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>.
*** Bug 19634 has been marked as a duplicate of this bug. ***
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
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.
Created attachment 94534 [details] Proposed "fix": Land the test case
Comment on attachment 94534 [details] Proposed "fix": Land the test case Looks fine.
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 on attachment 94534 [details] Proposed "fix": Land the test case Clearing flags on attachment: 94534 Committed r87265: <http://trac.webkit.org/changeset/87265>
All reviewed patches have been landed. Closing bug.