Document.body should return the *first* body / frameset child of the html element as per the specification:
Chrome and Firefox both behave correctly. However, WebKit first looks for a frameset child and returns it if it find one. It then falls back to looking for a body child. document.body thus returns a wrong result in this case:
This is covered by the following newly imported W3C test:
Created attachment 260568 [details]
Comment on attachment 260568 [details]
Clearing flags on attachment: 260568
Committed r189354: <http://trac.webkit.org/changeset/189354>
All reviewed patches have been landed. Closing bug.