mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Implement HTMLHyperlinkElementUtils for HTMLAnchorElement
This commit is contained in:
parent
446783f7b6
commit
c96c26b4f7
26 changed files with 369 additions and 1606 deletions
|
@ -21,6 +21,7 @@ impl UrlHelper {
|
|||
}
|
||||
|
||||
pub fn SetHash(url: &mut Url, value: USVString) {
|
||||
url.fragment = Some(String::new());
|
||||
let mut wrapper = UrlUtilsWrapper { url: url, parser: &UrlParser::new() };
|
||||
let _ = wrapper.set_fragment(&value.0);
|
||||
}
|
||||
|
@ -101,6 +102,9 @@ impl UrlHelper {
|
|||
}
|
||||
|
||||
pub fn SetPathname(url: &mut Url, value: USVString) {
|
||||
if let Some(path) = url.path_mut() {
|
||||
path.clear();
|
||||
}
|
||||
let mut wrapper = UrlUtilsWrapper { url: url, parser: &UrlParser::new() };
|
||||
let _ = wrapper.set_path(&value.0);
|
||||
}
|
||||
|
@ -149,6 +153,7 @@ impl UrlHelper {
|
|||
}
|
||||
|
||||
pub fn SetSearch(url: &mut Url, value: USVString) {
|
||||
url.query = Some(String::new());
|
||||
let mut wrapper = UrlUtilsWrapper { url: url, parser: &UrlParser::new() };
|
||||
let _ = wrapper.set_query(&value.0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue