mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Updated trigger_fragment to take a string instead of URL and updated callers
This commit is contained in:
parent
f5cb1690bf
commit
3e33a0b633
2 changed files with 12 additions and 9 deletions
|
@ -372,10 +372,13 @@ impl<'a> WindowHelpers for JSRef<'a, Window> {
|
|||
let url = UrlParser::new().base_url(&base_url).parse(href.as_slice());
|
||||
// FIXME: handle URL parse errors more gracefully.
|
||||
let url = url.unwrap();
|
||||
if href.as_slice().starts_with("#") {
|
||||
self.script_chan.send(ScriptMsg::TriggerFragment(self.page.id, url));
|
||||
} else {
|
||||
self.script_chan.send(ScriptMsg::TriggerLoad(self.page.id, LoadData::new(url)));
|
||||
match url.fragment {
|
||||
Some(fragment) => {
|
||||
self.script_chan.send(ScriptMsg::TriggerFragment(self.page.id, fragment));
|
||||
},
|
||||
None => {
|
||||
self.script_chan.send(ScriptMsg::TriggerLoad(self.page.id, LoadData::new(url)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue