Project

Profile

Help

Bug #4401

closed

HTML serialization: position of DOCTYPE declaration

Added by Michael Kay over 4 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
2019-12-03
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

The W3C serialization specification says that with the HTML output method, the DOCTYPE declaration should appear "immediately before" the first start-element tag. That implies it should appear after any opening comments and processing instructions. I'm pretty sure we output it before any opening comments and PIs.

Need to check against the HTML spec to see what makes most sense.

Note also, we've had a couple of people trying to output PHP using the HTML output method, and stumbling over the fact that the HTML output method outputs PIs with a closing ">" rather than "?>". We've also had requests to suppress the DOCTYPE output for HTML-5.

Please register to edit this issue

Also available in: Atom PDF