mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-16 08:18:59 +00:00
dom: implement ProcessingIntruction.target
This commit is contained in:
@@ -258,7 +258,8 @@ pub fn testExecFn(
|
|||||||
try checkCases(js_env, &createComment);
|
try checkCases(js_env, &createComment);
|
||||||
|
|
||||||
var createProcessingInstruction = [_]Case{
|
var createProcessingInstruction = [_]Case{
|
||||||
.{ .src = "document.createProcessingInstruction('foo', 'bar')", .ex = "[object ProcessingInstruction]" },
|
.{ .src = "let pi = document.createProcessingInstruction('foo', 'bar')", .ex = "undefined" },
|
||||||
|
.{ .src = "pi.target", .ex = "foo" },
|
||||||
};
|
};
|
||||||
try checkCases(js_env, &createProcessingInstruction);
|
try checkCases(js_env, &createProcessingInstruction);
|
||||||
|
|
||||||
|
|||||||
@@ -10,5 +10,8 @@ pub const ProcessingInstruction = struct {
|
|||||||
pub const prototype = *CharacterData;
|
pub const prototype = *CharacterData;
|
||||||
pub const mem_guarantied = true;
|
pub const mem_guarantied = true;
|
||||||
|
|
||||||
// TODO implement get_target
|
pub fn get_target(self: *parser.ProcessingInstruction) ![]const u8 {
|
||||||
|
// libdom stores the ProcessingInstruction target in the node's name.
|
||||||
|
return try parser.nodeName(@as(*parser.Node, @ptrCast(self)));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user