mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-30 15:41:48 +00:00
dom: implement document constructor
This commit is contained in:
@@ -22,10 +22,9 @@ pub const Document = struct {
|
|||||||
pub const prototype = *Node;
|
pub const prototype = *Node;
|
||||||
pub const mem_guarantied = true;
|
pub const mem_guarantied = true;
|
||||||
|
|
||||||
// pub fn constructor() *parser.Document {
|
pub fn constructor() *parser.Document {
|
||||||
// // TODO
|
return parser.domImplementationCreateHTMLDocument(null);
|
||||||
// return .{};
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
// JS funcs
|
// JS funcs
|
||||||
// --------
|
// --------
|
||||||
@@ -208,6 +207,16 @@ pub fn testExecFn(
|
|||||||
};
|
};
|
||||||
try checkCases(js_env, &getImplementation);
|
try checkCases(js_env, &getImplementation);
|
||||||
|
|
||||||
|
var new = [_]Case{
|
||||||
|
.{ .src = "let d = new Document()", .ex = "undefined" },
|
||||||
|
.{ .src = "d.characterSet", .ex = "UTF-8" },
|
||||||
|
.{ .src = "d.URL", .ex = "about:blank" },
|
||||||
|
.{ .src = "d.documentURI", .ex = "about:blank" },
|
||||||
|
.{ .src = "d.compatMode", .ex = "CSS1Compat" },
|
||||||
|
.{ .src = "d.contentType", .ex = "text/html" },
|
||||||
|
};
|
||||||
|
try checkCases(js_env, &new);
|
||||||
|
|
||||||
const tags = comptime parser.Tag.all();
|
const tags = comptime parser.Tag.all();
|
||||||
comptime var createElements: [(tags.len) * 2]Case = undefined;
|
comptime var createElements: [(tags.len) * 2]Case = undefined;
|
||||||
inline for (tags, 0..) |tag, i| {
|
inline for (tags, 0..) |tag, i| {
|
||||||
|
|||||||
Reference in New Issue
Block a user