Area: html/dom (98.6% pass)
Summary
document.body returns a synthetic <body> even for a document that has none, and the getter/setter don't follow the spec for childless / non-<body> root cases.
FAIL [2/26] html/dom/documents/dom-tree-accessors/Document.body.html
— Childless document: assert_equals: expected null but got Element node <body></body>
Expected
Per HTML §dom-document-body: document.body is the first child of the document element that is a <body> or <frameset>, or null if there is none. Setting body replaces/insets per spec and throws HierarchyRequestError for non-body/frameset values. A childless document must return null, not a fabricated body.
Repro
cargo run --release -p wpt-runner -- ./wpt html/dom/documents/dom-tree-accessors/Document.body.html 100
Area:
html/dom(98.6% pass)Summary
document.bodyreturns a synthetic<body>even for a document that has none, and the getter/setter don't follow the spec for childless / non-<body>root cases.Expected
Per HTML §dom-document-body:
document.bodyis the first child of the document element that is a<body>or<frameset>, ornullif there is none. Settingbodyreplaces/insets per spec and throwsHierarchyRequestErrorfor non-body/frameset values. A childless document must returnnull, not a fabricated body.Repro