Merge pull request #660 from lightpanda-io/implementation-update

implementation: remove the setTitle method call
This commit is contained in:
Pierre Tachoire
2025-05-19 16:14:46 +02:00
committed by GitHub
2 changed files with 4 additions and 2 deletions

View File

@@ -61,7 +61,10 @@ test "Browser.DOM.Implementation" {
try runner.testCases(&.{
.{ "let impl = document.implementation", "undefined" },
.{ "impl.createHTMLDocument();", "[object HTMLDocument]" },
.{ "impl.createHTMLDocument('foo');", "[object HTMLDocument]" },
.{ "const doc = impl.createHTMLDocument('foo');", "undefined" },
.{ "doc", "[object HTMLDocument]" },
.{ "doc.title", "foo" },
.{ "doc.body", "[object HTMLBodyElement]" },
.{ "impl.createDocument(null, 'foo');", "[object Document]" },
.{ "impl.createDocumentType('foo', 'bar', 'baz')", "[object DocumentType]" },
.{ "impl.hasFeature()", "true" },

View File

@@ -1920,7 +1920,6 @@ pub inline fn domImplementationCreateHTMLDocument(title: ?[]const u8) !*Document
_ = try nodeAppendChild(elementToNode(html), elementToNode(head));
if (title) |t| {
try documentHTMLSetTitle(doc_html, t);
const htitle = try documentCreateElement(doc, "title");
const txt = try documentCreateTextNode(doc, t);
_ = try nodeAppendChild(elementToNode(htitle), @as(*Node, @ptrCast(txt)));