diff options
author | Ms2ger <ms2ger@gmail.com> | 2014-03-12 14:30:19 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2014-03-12 14:30:19 +0100 |
commit | a15cac53bc4278e409ca850a79519f5d54e662b5 (patch) | |
tree | 4fd67e7f0b16e71111d395e6f9cadfc908550065 /src/components/script/dom/document.rs | |
parent | af616dba58cbf589b116b9e3cde4429df43e72cd (diff) | |
download | servo-a15cac53bc4278e409ca850a79519f5d54e662b5.tar.gz servo-a15cac53bc4278e409ca850a79519f5d54e662b5.zip |
Don't use the Untraceable fields outside the module they're defined in.
This pattern will become illegal with the next Rust upgrade.
Diffstat (limited to 'src/components/script/dom/document.rs')
-rw-r--r-- | src/components/script/dom/document.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/components/script/dom/document.rs b/src/components/script/dom/document.rs index 07660e30e88..27e209731e3 100644 --- a/src/components/script/dom/document.rs +++ b/src/components/script/dom/document.rs @@ -61,7 +61,7 @@ pub struct Document { content_type: DOMString, encoding_name: DOMString, is_html_document: bool, - extra: Untraceable, + priv extra: Untraceable, } struct Untraceable { @@ -139,6 +139,12 @@ impl Document { } impl Document { + pub fn url<'a>(&'a self) -> &'a Url { + &self.extra.url + } +} + +impl Document { // http://dom.spec.whatwg.org/#dom-document pub fn Constructor(owner: &JS<Window>) -> Fallible<JS<Document>> { Ok(Document::new(owner, None, NonHTMLDocument, None)) @@ -166,7 +172,7 @@ impl Document { // http://dom.spec.whatwg.org/#dom-document-url pub fn URL(&self) -> DOMString { - self.extra.url.to_str() + self.url().to_str() } // http://dom.spec.whatwg.org/#dom-document-documenturi |