aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/document.rs
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2015-08-17 21:29:41 -0700
committerMichael Howell <michael@notriddle.com>2015-08-18 17:35:09 -0700
commitaf31e8ed0f3f74908fb2c970e8b2f254ba0d70bd (patch)
treeda37325a6c18ac6bf1857c8828a2574ee702678a /components/script/dom/document.rs
parent72fa45155b93a9763967cf215e3a9e60e3883cd9 (diff)
downloadservo-af31e8ed0f3f74908fb2c970e8b2f254ba0d70bd.tar.gz
servo-af31e8ed0f3f74908fb2c970e8b2f254ba0d70bd.zip
Navigate to a new page even when there's a fragment.
Closes #7169
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r--components/script/dom/document.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index c3d81e20ba5..180edc0b289 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -256,7 +256,7 @@ pub trait DocumentHelpers<'a> {
fn disarm_reflow_timeout(self);
fn unregister_named_element(self, to_unregister: &Element, id: Atom);
fn register_named_element(self, element: &Element, id: Atom);
- fn find_fragment_node(self, fragid: DOMString) -> Option<Root<Element>>;
+ fn find_fragment_node(self, fragid: &str) -> Option<Root<Element>>;
fn hit_test(self, point: &Point2D<f32>) -> Option<UntrustedNodeAddress>;
fn get_nodes_under_mouse(self, point: &Point2D<f32>) -> Vec<UntrustedNodeAddress>;
fn set_ready_state(self, state: DocumentReadyState);
@@ -513,12 +513,12 @@ impl<'a> DocumentHelpers<'a> for &'a Document {
/// Attempt to find a named element in this page's document.
/// https://html.spec.whatwg.org/multipage/#the-indicated-part-of-the-document
- fn find_fragment_node(self, fragid: DOMString) -> Option<Root<Element>> {
- self.GetElementById(fragid.clone()).or_else(|| {
+ fn find_fragment_node(self, fragid: &str) -> Option<Root<Element>> {
+ self.GetElementById(fragid.to_owned()).or_else(|| {
let check_anchor = |&node: &&HTMLAnchorElement| {
let elem = ElementCast::from_ref(node);
elem.get_attribute(&ns!(""), &atom!("name")).map_or(false, |attr| {
- &**attr.r().value() == &*fragid
+ &**attr.r().value() == fragid
})
};
let doc_node = NodeCast::from_ref(self);