mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13:28 +00:00
browser: inject document URL
This commit is contained in:
@@ -224,7 +224,9 @@ pub const Page = struct {
|
||||
// TODO set document.readyState to interactive
|
||||
// https://html.spec.whatwg.org/#reporting-document-loading-status
|
||||
|
||||
// TODO inject the URL to the document including the fragment.
|
||||
// inject the URL to the document including the fragment.
|
||||
try parser.documentSetDocumentURI(doc, self.rawuri orelse "about:blank");
|
||||
|
||||
// TODO set the referrer to the document.
|
||||
|
||||
self.session.window.replaceDocument(doc);
|
||||
|
||||
@@ -1653,6 +1653,11 @@ pub inline fn documentGetDocumentURI(doc: *Document) ![]const u8 {
|
||||
return strToData(s.?);
|
||||
}
|
||||
|
||||
pub fn documentSetDocumentURI(doc: *Document, uri: []const u8) !void {
|
||||
const err = documentVtable(doc).dom_document_set_uri.?(doc, try strFromData(uri));
|
||||
try DOMErr(err);
|
||||
}
|
||||
|
||||
pub inline fn documentGetInputEncoding(doc: *Document) ![]const u8 {
|
||||
var s: ?*String = undefined;
|
||||
const err = documentVtable(doc).dom_document_get_input_encoding.?(doc, &s);
|
||||
|
||||
Reference in New Issue
Block a user