mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13:28 +00:00
fix some spelling in comments
This commit is contained in:
@@ -336,7 +336,7 @@ pub const Page = struct {
|
|||||||
|
|
||||||
const http_active = http_client.active;
|
const http_active = http_client.active;
|
||||||
if (http_active == 0 and exit_when_done) {
|
if (http_active == 0 and exit_when_done) {
|
||||||
// we don't need to concider http_client.intercepted here
|
// we don't need to consider http_client.intercepted here
|
||||||
// because exit_when_done is true, and that can only be
|
// because exit_when_done is true, and that can only be
|
||||||
// the case when interception isn't possible.
|
// the case when interception isn't possible.
|
||||||
std.debug.assert(http_client.intercepted == 0);
|
std.debug.assert(http_client.intercepted == 0);
|
||||||
@@ -823,12 +823,12 @@ pub const Page = struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The transfer arena is useful and interesting, but has a weird lifetime.
|
// The transfer arena is useful and interesting, but has a weird lifetime.
|
||||||
// When we're transfering from one page to another (via delayed navigation)
|
// When we're transferring from one page to another (via delayed navigation)
|
||||||
// we need things in memory: like the URL that we're navigating to and
|
// we need things in memory: like the URL that we're navigating to and
|
||||||
// optionally the body to POST. That cannot exist in the page.arena, because
|
// optionally the body to POST. That cannot exist in the page.arena, because
|
||||||
// the page that we have is going to be destroyed and a new page is going
|
// the page that we have is going to be destroyed and a new page is going
|
||||||
// to be created. If we used the page.arena, we'd wouldn't be able to reset
|
// to be created. If we used the page.arena, we'd wouldn't be able to reset
|
||||||
// it between navigations.
|
// it between navigation.
|
||||||
// So the transfer arena is meant to exist between a navigation event. It's
|
// So the transfer arena is meant to exist between a navigation event. It's
|
||||||
// freed when the main html navigation is complete, either in pageDoneCallback
|
// freed when the main html navigation is complete, either in pageDoneCallback
|
||||||
// or pageErrorCallback. It needs to exist for this long because, if we set
|
// or pageErrorCallback. It needs to exist for this long because, if we set
|
||||||
@@ -1159,7 +1159,7 @@ pub export fn scriptAddedCallback(ctx: ?*anyopaque, element: ?*parser.Element) c
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// It's posisble for a script to be dynamically added without a src.
|
// It's possible for a script to be dynamically added without a src.
|
||||||
// const s = document.createElement('script');
|
// const s = document.createElement('script');
|
||||||
// document.getElementsByTagName('body')[0].appendChild(s);
|
// document.getElementsByTagName('body')[0].appendChild(s);
|
||||||
// The src can be set after. We handle that in HTMLScriptElement.set_src,
|
// The src can be set after. We handle that in HTMLScriptElement.set_src,
|
||||||
|
|||||||
@@ -1395,7 +1395,7 @@ pub fn Env(comptime State: type, comptime WebApis: type) type {
|
|||||||
},
|
},
|
||||||
.@"struct" => {
|
.@"struct" => {
|
||||||
// We don't want to duplicate the code for this, so we call
|
// We don't want to duplicate the code for this, so we call
|
||||||
// the actual coversion function.
|
// the actual conversion function.
|
||||||
const value = (try self.jsValueToStruct(named_function, T, js_value)) orelse {
|
const value = (try self.jsValueToStruct(named_function, T, js_value)) orelse {
|
||||||
return .{ .invalid = {} };
|
return .{ .invalid = {} };
|
||||||
};
|
};
|
||||||
@@ -1494,7 +1494,7 @@ pub fn Env(comptime State: type, comptime WebApis: type) type {
|
|||||||
|
|
||||||
// We were hoping to find the module in our cache, and thus used
|
// We were hoping to find the module in our cache, and thus used
|
||||||
// the short-lived call_arena to create the normalized_specifier.
|
// the short-lived call_arena to create the normalized_specifier.
|
||||||
// But now this'll live for the lifetime of the context.
|
// But now this will live for the lifetime of the context.
|
||||||
const arena = self.context_arena;
|
const arena = self.context_arena;
|
||||||
const owned_specifier = try arena.dupe(u8, normalized_specifier);
|
const owned_specifier = try arena.dupe(u8, normalized_specifier);
|
||||||
try self.module_cache.put(arena, owned_specifier, PersistentModule.init(self.isolate, m));
|
try self.module_cache.put(arena, owned_specifier, PersistentModule.init(self.isolate, m));
|
||||||
@@ -2098,7 +2098,7 @@ pub fn Env(comptime State: type, comptime WebApis: type) type {
|
|||||||
// a shorthand method to return either the entire stack message
|
// a shorthand method to return either the entire stack message
|
||||||
// or just the exception message
|
// or just the exception message
|
||||||
// - in Debug mode return the stack if available
|
// - in Debug mode return the stack if available
|
||||||
// - otherwhise return the exception if available
|
// - otherwise return the exception if available
|
||||||
// the caller needs to deinit the string returned
|
// the caller needs to deinit the string returned
|
||||||
pub fn err(self: TryCatch, allocator: Allocator) !?[]const u8 {
|
pub fn err(self: TryCatch, allocator: Allocator) !?[]const u8 {
|
||||||
if (builtin.mode == .Debug) {
|
if (builtin.mode == .Debug) {
|
||||||
@@ -2579,7 +2579,7 @@ pub fn Env(comptime State: type, comptime WebApis: type) type {
|
|||||||
// If you're trying to implement setter, read:
|
// If you're trying to implement setter, read:
|
||||||
// https://groups.google.com/g/v8-users/c/8tahYBsHpgY/m/IteS7Wn2AAAJ
|
// https://groups.google.com/g/v8-users/c/8tahYBsHpgY/m/IteS7Wn2AAAJ
|
||||||
// The issue I had was
|
// The issue I had was
|
||||||
// (a) where to attache it: does it go ont he instance_template
|
// (a) where to attache it: does it go on the instance_template
|
||||||
// instead of the prototype?
|
// instead of the prototype?
|
||||||
// (b) defining the getter or query to respond with the
|
// (b) defining the getter or query to respond with the
|
||||||
// PropertyAttribute to indicate if the property can be set
|
// PropertyAttribute to indicate if the property can be set
|
||||||
@@ -2751,7 +2751,7 @@ pub fn Env(comptime State: type, comptime WebApis: type) type {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (T == Function) {
|
if (T == Function) {
|
||||||
// we're returnig a callback
|
// we're returning a callback
|
||||||
return value.func.toValue();
|
return value.func.toValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2876,8 +2876,8 @@ pub fn Env(comptime State: type, comptime WebApis: type) type {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Callback called on global's property mssing.
|
// Callback called on global's property missing.
|
||||||
// Return true to intercept the exectution or false to let the call
|
// Return true to intercept the execution or false to let the call
|
||||||
// continue the chain.
|
// continue the chain.
|
||||||
pub const GlobalMissingCallback = struct {
|
pub const GlobalMissingCallback = struct {
|
||||||
ptr: *anyopaque,
|
ptr: *anyopaque,
|
||||||
@@ -2951,10 +2951,10 @@ fn isComplexAttributeType(ti: std.builtin.Type) bool {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Responsible for calling Zig functions from JS invokations. This could
|
// Responsible for calling Zig functions from JS invocations. This could
|
||||||
// probably just contained in ExecutionWorld, but having this specific logic, which
|
// probably just contained in ExecutionWorld, but having this specific logic, which
|
||||||
// is somewhat repetitive between constructors, functions, getters, etc contained
|
// is somewhat repetitive between constructors, functions, getters, etc contained
|
||||||
// here does feel like it makes it clenaer.
|
// here does feel like it makes it cleaner.
|
||||||
fn Caller(comptime JsContext: type, comptime State: type) type {
|
fn Caller(comptime JsContext: type, comptime State: type) type {
|
||||||
return struct {
|
return struct {
|
||||||
js_context: *JsContext,
|
js_context: *JsContext,
|
||||||
@@ -3356,7 +3356,7 @@ fn Caller(comptime JsContext: type, comptime State: type) type {
|
|||||||
var is_variadic = false;
|
var is_variadic = false;
|
||||||
|
|
||||||
{
|
{
|
||||||
// This is going to get complicated. If the last Zig paremeter
|
// This is going to get complicated. If the last Zig parameter
|
||||||
// is a slice AND the corresponding javascript parameter is
|
// is a slice AND the corresponding javascript parameter is
|
||||||
// NOT an an array, then we'll treat it as a variadic.
|
// NOT an an array, then we'll treat it as a variadic.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user