-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
05d31eb
commit 410c887
Showing
4 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const std = @import("std"); | ||
|
||
const parser = @import("../netsurf.zig"); | ||
|
||
const Node = @import("node.zig").Node; | ||
|
||
// WEB IDL https://dom.spec.whatwg.org/#documenttype | ||
pub const DocumentType = struct { | ||
pub const Self = parser.DocumentType; | ||
pub const prototype = *Node; | ||
pub const mem_guarantied = true; | ||
|
||
pub fn get_name(self: *parser.DocumentType) []const u8 { | ||
return parser.documentTypeGetName(self); | ||
} | ||
|
||
pub fn get_publicId(self: *parser.DocumentType) []const u8 { | ||
return parser.documentTypeGetPublicId(self); | ||
} | ||
|
||
pub fn get_systemId(self: *parser.DocumentType) []const u8 { | ||
return parser.documentTypeGetSystemId(self); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html PUBLIC "STAFF" "staffNS.dtd"> | ||
<title>DocumentType literals</title> | ||
<link rel="help" href="https://dom.spec.whatwg.org/#dom-documenttype-name"> | ||
<link rel="help" href="https://dom.spec.whatwg.org/#dom-documenttype-publicid"> | ||
<link rel="help" href="https://dom.spec.whatwg.org/#dom-documenttype-systemid"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<div id="log"></div> | ||
<script> | ||
test(function() { | ||
var doctype = document.firstChild; | ||
assert_true(doctype instanceof DocumentType) | ||
assert_equals(doctype.name, "html") | ||
assert_equals(doctype.publicId, 'STAFF') | ||
assert_equals(doctype.systemId, 'staffNS.dtd') | ||
}) | ||
</script> |