Skip to content

Commit

Permalink
Implement Navigator.appVersion(#5409)
Browse files Browse the repository at this point in the history
  • Loading branch information
deokjinkim committed Mar 31, 2015
1 parent 1bd8e18 commit c0e691b
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 16 deletions.
4 changes: 4 additions & 0 deletions components/script/dom/navigator.rs
Expand Up @@ -54,5 +54,9 @@ impl<'a> NavigatorMethods for JSRef<'a, Navigator> {
fn UserAgent(self) -> DOMString {
navigatorinfo::UserAgent()
}

fn AppVersion(self) -> DOMString {
navigatorinfo::AppVersion()
}
}

4 changes: 4 additions & 0 deletions components/script/dom/navigatorinfo.rs
Expand Up @@ -33,3 +33,7 @@ pub fn UserAgent() -> DOMString {
None => "".to_owned(),
}
}

pub fn AppVersion() -> DOMString {
"4.0".to_owned()
}
2 changes: 1 addition & 1 deletion components/script/dom/webidls/Navigator.webidl
Expand Up @@ -19,7 +19,7 @@ Navigator implements NavigatorID;
interface NavigatorID {
readonly attribute DOMString appCodeName; // constant "Mozilla"
readonly attribute DOMString appName;
//readonly attribute DOMString appVersion;
readonly attribute DOMString appVersion;
readonly attribute DOMString platform;
readonly attribute DOMString product; // constant "Gecko"
boolean taintEnabled(); // constant false
Expand Down
4 changes: 4 additions & 0 deletions components/script/dom/workernavigator.rs
Expand Up @@ -55,5 +55,9 @@ impl<'a> WorkerNavigatorMethods for JSRef<'a, WorkerNavigator> {
fn UserAgent(self) -> DOMString {
navigatorinfo::UserAgent()
}

fn AppVersion(self) -> DOMString {
navigatorinfo::AppVersion()
}
}

1 change: 1 addition & 0 deletions tests/content/test_navigator.html
Expand Up @@ -14,6 +14,7 @@
is(nav.appName, "Netscape");
is(nav.appCodeName, "Mozilla");
is(nav.platform, "");
is(nav.appVersion, "4.0");
</script>
</body>
</html>
9 changes: 0 additions & 9 deletions tests/wpt/metadata/html/dom/interfaces.html.ini
Expand Up @@ -8637,9 +8637,6 @@
[Navigator interface object length]
expected: FAIL
[Navigator interface: attribute appVersion]
expected: FAIL
[Navigator interface: attribute language]
expected: FAIL
Expand Down Expand Up @@ -8682,9 +8679,6 @@
[Navigator interface: attribute javaEnabled]
expected: FAIL
[Navigator interface: window.navigator must inherit property "appVersion" with the proper type (2)]
expected: FAIL
[Navigator interface: window.navigator must inherit property "language" with the proper type (7)]
expected: FAIL
Expand Down Expand Up @@ -9231,9 +9225,6 @@
[WorkerNavigator interface object length]
expected: FAIL
[WorkerNavigator interface: attribute appVersion]
expected: FAIL
[WorkerNavigator interface: attribute language]
expected: FAIL
Expand Down
6 changes: 0 additions & 6 deletions tests/wpt/metadata/workers/interfaces.worker.js.ini
Expand Up @@ -81,9 +81,6 @@
[WorkerNavigator interface object length]
expected: FAIL

[WorkerNavigator interface: attribute appVersion]
expected: FAIL

[WorkerNavigator interface: attribute language]
expected: FAIL

Expand All @@ -93,9 +90,6 @@
[WorkerNavigator interface: attribute onLine]
expected: FAIL

[WorkerNavigator interface: self.navigator must inherit property "appVersion" with the proper type (2)]
expected: FAIL

[WorkerNavigator interface: self.navigator must inherit property "language" with the proper type (7)]
expected: FAIL

Expand Down

5 comments on commit c0e691b

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from jdm
at deokjinkim@c0e691b

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging deokjinkim/servo/navigator_appversion = c0e691b into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deokjinkim/servo/navigator_appversion = c0e691b merged ok, testing candidate = 225d7d2

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 225d7d2

Please sign in to comment.