Add a new method to components/script/dom/globalscope.rs which checks if
the global is a Window , then uses
window.Document().encoding_parse_a_url(..) if so. For non-Window
globals, just use the existing logic of getting the api_base_url() value
and calling join(..) on it.
Testing: Existing WPTs.
Fixes: #43509
---------
Signed-off-by: Jayanta Pradhan <pradhanjayanta91@gmail.com>