mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Initial spec-incompliant implementation of default click action for anchor elements.
This is cherry-picked from https://github.com/mozilla/servo/pull/1688: * Initial spec-incompliant implementation of default click action for anchor elements. * Add documentation; gut the new document URL loading method and move it all into the new Window method. * Add test for default event prevention. Original developer: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
c753f3ee05
commit
46d31632e0
7 changed files with 169 additions and 39 deletions
|
@ -83,6 +83,7 @@ pub trait DocumentHelpers {
|
|||
fn wait_until_safe_to_modify_dom(&self);
|
||||
fn unregister_named_element(&mut self, to_unregister: &JSRef<Element>, id: DOMString);
|
||||
fn register_named_element(&mut self, element: &JSRef<Element>, id: DOMString);
|
||||
fn load_anchor_href(&self, href: DOMString);
|
||||
}
|
||||
|
||||
impl<'a> DocumentHelpers for JSRef<'a, Document> {
|
||||
|
@ -176,6 +177,11 @@ impl<'a> DocumentHelpers for JSRef<'a, Document> {
|
|||
elements.push_unrooted(element);
|
||||
self.idmap.insert(id, elements);
|
||||
}
|
||||
|
||||
fn load_anchor_href(&self, href: DOMString) {
|
||||
let mut window = self.window.root();
|
||||
window.load_url(href);
|
||||
}
|
||||
}
|
||||
|
||||
impl Document {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue