mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-28 22:53:28 +00:00
reinitialize search_params too when href set
This commit is contained in:
@@ -281,10 +281,11 @@ pub const URL = struct {
|
|||||||
/// `Internal` error for failing cases.
|
/// `Internal` error for failing cases.
|
||||||
const SetterError = error{Internal};
|
const SetterError = error{Internal};
|
||||||
|
|
||||||
// FIXME: reinit search_params?
|
pub fn set_href(self: *URL, input: []const u8, page: *Page) !void {
|
||||||
pub fn set_href(self: *const URL, input: []const u8) SetterError!void {
|
|
||||||
_ = ada.setHref(self.internal, input);
|
_ = ada.setHref(self.internal, input);
|
||||||
if (!ada.isValid(self.internal)) return error.Internal;
|
if (!ada.isValid(self.internal)) return error.Internal;
|
||||||
|
// Can't call `get_search` here since it uses `search_params`.
|
||||||
|
self.search_params = try prepareSearchParams(page.arena, self.internal);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_host(self: *const URL, input: []const u8) SetterError!void {
|
pub fn set_host(self: *const URL, input: []const u8) SetterError!void {
|
||||||
|
|||||||
Reference in New Issue
Block a user