Skip to content

Conversation

nikneym
Copy link
Contributor

@nikneym nikneym commented Oct 21, 2025

This PR moves #1127's web API changes to this PR. We can swap-in to ada-url in CDP and close the initial PR once that become a necessity.

  • Refactors URL.
  • Refactors HTMLAnchorElement.

Closes #1111.

Also add ada-url bindings.
This still doesn't use `state` since `state` doesn't allow us to iterate the nodes when releasing the memory and we need to call `URL.destructor` when freeing. In the future, we might omit getter allocations by making such change.
return parser.anchorSetHref(self, href);
}

// TODO return a disposable string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using the call_arena fixes this comment.

Suggested change
// TODO return a disposable string

return parser.anchorSetHref(self, href);
}

// TODO return a disposable string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using the call_arena fixes this comment.

Suggested change
// TODO return a disposable string

return parser.anchorSetHref(self, href);
}

// TODO return a disposable string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// TODO return a disposable string

return error.NotProvided;
}

// TODO return a disposable string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// TODO return a disposable string

return u.get_origin(page);
}

// TODO return a disposable string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// TODO return a disposable string

return parser.anchorSetHref(self, href);
}

// TODO return a disposable string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// TODO return a disposable string

return parser.anchorSetHref(self, href);
}

// TODO return a disposable string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// TODO return a disposable string

</script>

<script id=invalidUrl>
let u = new URL("://foo.bar/path?query#fragment");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about testing if the error is thrown instead?

const SetterError = error{Internal};

return try std.mem.concat(arena, u8, &[_][]const u8{ "#", uriComponentNullStr(self.uri.fragment) });
// FIXME: reinit search_params?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I sounds like we should reset and parse search params too indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid URL parsing

3 participants