Created attachment 69768 [details]
Please see attachment files, test1.html and test2.html. The only difference between them is whether there is a 'new-line' at the end of file or not.
- test1.html ends with 'new-line', like '... </html>\n<EOF>'
- test2.html does not end with 'new-line', like '.... </html><EOF>'.
The results differs in test1.html and test2.html:
- In test1.html, querySelectorAll returns a correct result, ['<div id="last">last</div>].
- In test2.html, querySelectorAll returns an empty list, , which is wrong result.
This might be a regression because Safari Version 5.0 (6533.16) returns the same correct results for both test1.html and test2.html.
Created attachment 69769 [details]
We had trouble with the last-child selector early on when developing the new tree builder. There's some API we need to call on an element when it's received its last child (as I recall). I'll possible we're screwing that up in this case.
The newline at the end of the file gets moved to just inside the body element, which might be confusing something.
Thanks for the report. I'll take a look.
Created attachment 72148 [details]
Comment on attachment 72148 [details]
OK. Your test case is really subtle. It should document that it's important to not have a newline at the end.
Would probably be clearer if you document.wrote the contnet into an ifram.
You mentioned there was a spec bug? What's the bug?
(In reply to comment #6)
> You mentioned there was a spec bug? What's the bug?
It's for one of the FIXME cases. It's just a typo in the spec.
Committed r71147: <http://trac.webkit.org/changeset/71147>