Move fragment navigation into Document object

Move the `check_and_scroll_fragment()` method into Document, make the
mothod set the fragment of url after navigation, and use the
`perform_a_scroll()` method to scroll rather than an individual
method. Also removes the broken `Window.fragment` fields.
This commit is contained in:
Pu Xingyu 2016-11-18 12:33:30 +08:00
parent eca8f1d0b4
commit 9863149043
5 changed files with 65 additions and 82 deletions

View file

@ -98,6 +98,10 @@ impl ServoUrl {
Arc::make_mut(&mut self.0).set_password(pass)
}
pub fn set_fragment(&mut self, fragment: Option<&str>) {
Arc::make_mut(&mut self.0).set_fragment(fragment)
}
pub fn username(&self) -> &str {
self.0.username()
}