mirror of
https://github.com/servo/servo.git
synced 2025-06-24 17:14:33 +01:00
Don't use the Untraceable fields outside the module they're defined in.
This pattern will become illegal with the next Rust upgrade.
This commit is contained in:
parent
af616dba58
commit
a15cac53bc
8 changed files with 23 additions and 9 deletions
|
@ -61,7 +61,7 @@ pub struct Document {
|
|||
content_type: DOMString,
|
||||
encoding_name: DOMString,
|
||||
is_html_document: bool,
|
||||
extra: Untraceable,
|
||||
priv extra: Untraceable,
|
||||
}
|
||||
|
||||
struct Untraceable {
|
||||
|
@ -138,6 +138,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>> {
|
||||
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue