Active
Project:
Lost & found issues
Component:
Twig templates conversion (front-end branch)
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
24 Oct 2012 at 19:01 UTC
Updated:
11 Feb 2013 at 18:46 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
EVIIILJ commentedWe might just want to kill the div for XHTML compliance within the twig template. Here's a patch including that change.
Comment #2
vlad.dancerI'm agree with you. RTBC
Comment #3
jenlamptonI'm going to commit this template to the front-end branch with the inner div (even though I agree with you). The comment in form.inc indicates that the div inside the form is required for XHTML compliance, can someone please confirm that removing it won't get us in trouble?
I'll add a TODO in the template so we can revisit the div removal, after someone does some research on compliance, since I dunno anything about it :)
Comment #4
decafdennis commentedFor background on the DIV inside the FORM element, see #690980: Disabled form elements not properly rendered.
Comment #5
jwilson3I just scanned #690980: Disabled form elements not properly rendered, and could find no reference about the inner div. Additionally, investigating one of the patches on that issue, even though that line was changed, it looks like the inner div existed before that issue.
From http://drupal.org/files/issues/drupal.form-disabled.102.patch
We still need to find out where the inner DIV was introduced, and read about why.
Comment #6
jwilson3A quick search through the git history turned up a commit eb030cb9d8839bd08cb2bd1e4f954efe37047303 from 2003 when the inner DIV was first added, whose commit message was "Improvements: XHTML-ifications. Patch by GmbH.", so it could be that the inner div was for Xhtml compliance.
I used git log -S\</div\>\</form\> to search the git history.
Comment #7
jwilson3My guess, from studying the XHTML DTD is that the inner div is there to ensure that you get valid XHTML, because
<form><input/></form>(according to the XHTML dtd, is invalid), but<form><div><input/></div></form>is valid.In plain english, the only valid elements inside the FORM tag include:
NOSCRIPT, INS, DEL, SCRIPT, P, H1-6, DIV, UL/OL/DL, PRE, HR, BLOCKQUOTE, ADDRESS, FIELDSET, TABLE.
and, INPUT is not a tag in that list.
On the other hand, the HTML 5.1 nightly draft specifically shows an example HTML snippet in the section about the form element that uses:
<form><label><input></form>.Comment #8
jwilson3Does anyone know what is the official stance for XHTML support in Drupal 8?