A comment at the beginning of a document causes WebKit to parse tags in some case-sensitive mode, so for example <DIV> is does not create an HTML DIV element. See attached test case.
Created attachment 19249 [details] Test case
Expected behavior of the test case is border around inside? If yes I cannot confirm the bug in Webkit r30377. DIV element is created in DOM. http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!--%20comment%20--%3E%0A%3CDIV%20style%3D%22border%3A%201px%20solid%3B%22%3EInside%20%3C%2FDIV%3E%0Aoutside
This is actually very specific, and is caused by the fact that DIV and DOCTYPE begin with the same letter. The lowercasing isn't in effect while searching for DOCTYPE so the D remains uppercase.
Fixed in <http://trac.webkit.org/projects/webkit/changeset/30455>.