8000 netsurf: documentHTMLSetBody and documentHTMLSetTitle must change the DOM tree · Issue #661 · lightpanda-io/browser · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
netsurf: documentHTMLSetBody and documentHTMLSetTitle must change the DOM tree #661
Open
@krichprollsch

Description

@krichprollsch

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 the title tag)
  • change documentHTMLSetBody to remove the existing body in the DOM tree and attach the new one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0