This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 10157 - Whitespace between <head> and <body> should be ignored
Summary: Whitespace between <head> and <body> should be ignored
Status: RESOLVED WONTFIX
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: PC All
: P1 critical
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://webblaze.org/abarth/tests/whit...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-13 21:15 UTC by Adam Barth
Modified: 2010-10-04 14:46 UTC (History)
6 users (show)

See Also:


Attachments

Description Adam Barth 2010-07-13 21:15:04 UTC
Consider the following document:

<html>
<head></head>
<body>
</body>
</html>

The tree builder algorithm will insert a text node containing whitespace between the head element and the body element.  As far as I can tell, IE, Firefox, Chrome, Safari, and Opera do not insert this text node:

http://webblaze.org/abarth/tests/whitenodes/

This page displays true when the whitespace nodes before and after the head element are not inserted into the DOM.

Is there a reason everyone should change their behavior here?
Comment 1 Ian 'Hixie' Hickson 2010-07-14 21:18:15 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: no spec change
Rationale: Whether we change in behaviour here or not doesn't affect the amount of effort implementations have to do (since they're all going to have to update their parsers and parser tests anyway). So this just ends up being a balance of legacy compatibility vs sanity. In this case, sanity says the whitespace should be preserved, and I'm not aware of any compatibility issues. Thus the spec.

There are other parts of the parser's whitespace handling (e.g. handling of spaces after </body>) where the sane behaviour wasn't compatible with the web, so compatibility won out.