WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
38901
empty divs (<div />) are not properly handled
https://bugs.webkit.org/show_bug.cgi?id=38901
Summary
empty divs (<div />) are not properly handled
Milian Wolff
Reported
2010-05-11 06:08:17 PDT
Empty divs are not properly handled in at least safari 3.2.1 and QWebKit from Qt 4.6.3. To reproduce see attached HTML and use e.g. the webinspector to investigate how WebKit interprets the DOM: it wrongly turns <div /><div /> into <div><div></div></div> instead of <div></div><div></div>
Attachments
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2010-05-12 14:10:41 PDT
This is correct parsing. It matches HTML5 and Firefox - and although I didn't test IE, I'm pretty sure it works the same. Note that "<div />" is exactly equivalent to "<div>" - the self-closing syntax is not supported in HTML, and all browsers simply ignore the slash.
Milian Wolff
Comment 2
2010-05-12 23:11:43 PDT
Just to get this right: 1) the document is XHTML conform and has a proper doctype for that, hence should imo adhere to the XML syntax - making this _not_ an invalid request 2) do you have any documentation / links to the standard that describe the behavior for plain HTML? I always thought that <tag /> was equivalent to <tag></tag> even there and afair it works for at least <a /> in Firefox or do you simply ignore it because the others also ignore it? thanks, have a nice day
Alexey Proskuryakov
Comment 3
2010-05-13 00:34:22 PDT
Please read <
http://hixie.ch/advocacy/xhtml
> for an explanation of why this is not XHTML, even if it looks like such to human eyes.
> 2) do you have any documentation / links to the standard that describe the behavior for plain HTML?
Any version of HTML standard would do. HTML5 describes this in most detail.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug