Skip to content

implement navigator.platform - #7582

Merged
bors-servo merged 1 commit into
servo:masterfrom
paulrouget:navigator.platform
Sep 29, 2015
Merged

bors-servo merged 1 commit into
servo:masterfrom
paulrouget:navigator.platform

Conversation

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Sep 9, 2015
@huonw

huonw commented Sep 10, 2015

Copy link
Copy Markdown
Contributor

FYI, one can use the cfg!(...) macro (rather than attribute) to write it all as a normal expression rather than having to have repeated definitions of the function, e.g.

if cfg!(all(any(target_os = "linux",
                       target_os = "android"),
                   target_arch = "x86_64")) {
    "Linux x86_64"
} else if cfg!(all(any(target_os = "linux",
                       target_os = "android"),
                   target_arch = "x86")) {
    "Linux i686"
} else {
    ""
}

@paulrouget

Copy link
Copy Markdown
Contributor Author

Didn't know that. This will probably be better. Thanks.

@paulrouget

Copy link
Copy Markdown
Contributor Author

Hm, with my current approach, it won't compile if the platform is not listed. So any port to a new platform requires adding a string for navigator.platorm. Which is, I believe, a good thing.

@huonw

huonw commented Sep 13, 2015

Copy link
Copy Markdown
Contributor

Good point; seems like a good thing to me too.

@nox

nox commented Sep 15, 2015

Copy link
Copy Markdown
Contributor

https://html.spec.whatwg.org/multipage/webappapis.html#dom-navigator-platform

Any information in this API that varies from user to user can be used to profile the user. In fact, if enough such information is available, a user can actually be uniquely identified. For this reason, user agent implementors are strongly urged to include as little information in this API as possible.

Couldn't we just emit a constant?

@paulrouget

Copy link
Copy Markdown
Contributor Author

Couldn't we just emit a constant?

What do you mean?

@nox

nox commented Sep 15, 2015 via email

Copy link
Copy Markdown
Contributor

@paulrouget

Copy link
Copy Markdown
Contributor Author

I mean to always return the same thing. Even on different plateforms.

This is how it works now. It always returns an empty string.

At the very least I am not sure the architecture is important to include.

For browser.html, we need navigator.platform to know what modifiers to use for the keybindings and what kind of window controls we should use. We don't care much about the architecture.

@paulrouget

Copy link
Copy Markdown
Contributor Author

I removed the architecture string.

@jdm

jdm commented Sep 16, 2015

Copy link
Copy Markdown
Member

-S-awaiting-review +S-needs-code-changes +@jdm


Reviewed 1 of 1 files at r1, 3 of 3 files at r2.
Review status: all files reviewed at latest revision, 2 unresolved discussions, all commit checks successful.


tests/wpt/mozilla/meta/mozilla/navigator.html.ini, line 6 [r2] (raw file):
Can we use `if os != "linux": FAIL?


tests/wpt/mozilla/meta/mozilla/navigator.html.ini, line 11 [r2] (raw file):
Ditto.


Comments from the review on Reviewable.io

@jdm jdm added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Sep 16, 2015
@jdm jdm self-assigned this Sep 16, 2015
@nox

nox commented Sep 17, 2015

Copy link
Copy Markdown
Contributor

For browser.html, we need navigator.platform to know what modifiers to use for the keybindings and what kind of window controls we should use. We don't care much about the architecture.

Do you mean that browser.html will reimplement input methods etc in JS land? Won't that have the same insane amount of issues like the Atom editor suffers from?

https://github.com/andischerer/atom-keyboard-localization/issues

@paulrouget

Copy link
Copy Markdown
Contributor Author

Do you mean that browser.html will reimplement input methods etc in JS land?

No. By “keybinding”, I refer to things like “Cmd-T” (which has nothing to do with text input), and "window controls” refers to the close|max|min buttons of a window.

@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Sep 21, 2015
@paulrouget

Copy link
Copy Markdown
Contributor Author

review ping

@jdm

jdm commented Sep 23, 2015

Copy link
Copy Markdown
Member

@bors-servo: r+
Thanks!


Reviewed 2 of 2 files at r3.
Review status: :shipit: all files reviewed at latest revision, all discussions resolved, all commit checks successful.


Comments from the review on Reviewable.io

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 6b49651 has been approved by jdm

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Sep 23, 2015
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 6b49651 with merge 5e814b7...

@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-dev

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Sep 23, 2015
@jdm

jdm commented Sep 23, 2015

Copy link
Copy Markdown
Member
/home/servo/buildbot/slave/linux-dev/build/components/script/dom/navigator.rs:56:9: 56:32 error: unresolved name `navigatorinfo::Platform`. Did you mean to call `self.navigatorinfo::Platform`? [E0425]
/home/servo/buildbot/slave/linux-dev/build/components/script/dom/navigator.rs:56         navigatorinfo::Platform()
                                                                                         ^~~~~~~~~~~~~~~~~~~~~~~
/home/servo/buildbot/slave/linux-dev/build/components/script/dom/navigator.rs:56:9: 56:32 help: run `rustc --explain E0425` to see a detailed explanation
/home/servo/buildbot/slave/linux-dev/build/components/script/dom/workernavigator.rs:57:9: 57:32 error: unresolved name `navigatorinfo::Platform`. Did you mean to call `self.navigatorinfo::Platform`? [E0425]
/home/servo/buildbot/slave/linux-dev/build/components/script/dom/workernavigator.rs:57         navigatorinfo::Platform()
                                                                                               ^~~~~~~~~~~~~~~~~~~~~~~
/home/servo/buildbot/slave/linux-dev/build/components/script/dom/workernavigator.rs:57:9: 57:32 help: run `rustc --explain E0425` to see a detailed explanation

@highfive highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Sep 29, 2015
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 132724b with merge f0b64fe...

@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - mac-dev-ref-unit

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Sep 29, 2015
@jdm

jdm commented Sep 29, 2015

Copy link
Copy Markdown
Member

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 132724b with merge aa2b87c...

@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - mac-rel-wpt

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Sep 29, 2015
@paulrouget

Copy link
Copy Markdown
Contributor Author

Intermittent? /html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.hex.html

@nox

nox commented Sep 29, 2015

Copy link
Copy Markdown
Contributor

@bors-servo retry

#7422

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 132724b with merge c356593...

@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - mac-rel-wpt

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Sep 29, 2015
@jdm

jdm commented Sep 29, 2015

Copy link
Copy Markdown
Member

Infrastructure failure; hold tight.

@metajack

Copy link
Copy Markdown
Collaborator

@bors-servo retry

  • infra issues addressed i hope

@bors-servo

Copy link
Copy Markdown
Contributor

⚡ Previous build results for android, gonk, linux-dev, mac-dev-ref-unit are reusable. Rebuilding only linux-rel, mac-rel-css, mac-rel-wpt...

@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-ref-unit, mac-rel-css, mac-rel-wpt

@bors-servo
bors-servo merged commit 132724b into servo:master Sep 29, 2015
@SimonSapin SimonSapin removed the S-tests-failed The changes caused existing tests to fail. label Jan 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants