mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Share code between Navigator and WorkerNavigator
Also shares code between Location and WorkerLocation. This has been done by introducing NavigatorInfo and UrlHelper. Fixes #3159
This commit is contained in:
parent
de67710934
commit
652d217961
7 changed files with 81 additions and 32 deletions
|
@ -7,6 +7,7 @@ use dom::bindings::codegen::Bindings::NavigatorBinding::NavigatorMethods;
|
|||
use dom::bindings::global::Window;
|
||||
use dom::bindings::js::{JSRef, Temporary};
|
||||
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
|
||||
use dom::navigatorinfo::NavigatorInfo;
|
||||
use dom::window::Window;
|
||||
use servo_util::str::DOMString;
|
||||
|
||||
|
@ -32,23 +33,23 @@ impl Navigator {
|
|||
|
||||
impl<'a> NavigatorMethods for JSRef<'a, Navigator> {
|
||||
fn Product(&self) -> DOMString {
|
||||
"Gecko".to_string()
|
||||
NavigatorInfo::Product()
|
||||
}
|
||||
|
||||
fn TaintEnabled(&self) -> bool {
|
||||
false
|
||||
NavigatorInfo::TaintEnabled()
|
||||
}
|
||||
|
||||
fn AppName(&self) -> DOMString {
|
||||
"Netscape".to_string() // Like Gecko/Webkit
|
||||
NavigatorInfo::AppName()
|
||||
}
|
||||
|
||||
fn AppCodeName(&self) -> DOMString {
|
||||
"Mozilla".to_string()
|
||||
NavigatorInfo::AppCodeName()
|
||||
}
|
||||
|
||||
fn Platform(&self) -> DOMString {
|
||||
"".to_string()
|
||||
NavigatorInfo::Platform()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue