Open
Description
The functions documentHTMLSetTitle
and documentHTMLSetBody
change libdom document attributes body
and title
but they don't change the DOM tree itself.
For example, if the document contains already a title
tag, calling documentHTMLSetTitle
doesn't change the tag itself, but the title
attribute only.
MDN says settings document.title
must affect the DOM.
The assignment affects the return value of document.title, the title displayed for the document (e.g., in the titlebar of the window or tab), and it also affects the DOM of the document (e.g., the content of the <title> element in an HTML document).
https://developer.mozilla.org/en-US/docs/Web/API/Document/title
The following test doesn't work:
document.title = 'foo';
document.title; // returns foo, it's OK
document.getElementsByTagName('title')[0].textContent; // should return foo, but fails
Goals
- change
documentHTMLSetTitle
to alter the DOM tree correctly (update or create thetitle
tag) - change
documentHTMLSetBody
to remove the existing body in the DOM tree and attach the new one.
Metadata
Metadata
Assignees
Labels
No labels