| Summary: | Environment provider for globals used by Orion | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Mihai Sucan <mihai.sucan> |
| Component: | Editor | Assignee: | Silenio Quarti <Silenio_Quarti> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | mihai.sucan, Silenio_Quarti |
| Version: | unspecified | ||
| Target Milestone: | 2.0 M1 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Mihai Sucan
Which globals are you interested? window document Are there others? We can start with window and document, but anything you can find that falls into the following category any global object you use that is not part of standard JS. Something that requires an actual DOM. JavaScript modules in Firefox do not have "window", "document" or any associated DOM. Beyond the two globals you mentioned: document.body is not always available, even in environments with a DOM. Another example is setTimeout - a global method that lives on the window object. Orion code needs to use it as follows: givenWindow.setTimeout. Any other similar global function or property needs to be explicitly taken from the window object. (clearTimeout, setInterval, clearInterval, navigator, location, etc.) Thank you very much for your work! Much appreciated! I have released changes that should take care of: window, document, setTimeout, clearTimeout, setInterval and clearInterval. These are fetched from the parent of text view now which is passed by the application at creation time. I am not sure what to do with respect to document.body. Do you have any ideas? Most of the references to document.body are in IE specific code. There is only one common reference in tooltip.js. There is one reference to navigator in util.js. It is used to determine OS and browser version. Is this an issue for you? Please let me know whether these changes fix your problem. http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=6da1defc4ebf5e71efffb0da1f3dc529f31f9c46 Thank you Silenio! Before we can make the change to run in a DOM-less environment we need to get all the globals figured-out. The changes you committed seem to be sufficient for now. We have to make our code changes before we can be sure that everything works well. The |navigator| global is known to not be available either, but that is immutable across different instances of Orion and we can add fake objects into the global scope, for all Orion instances at once. In the case of |navigator| it's actually better for us to fake it - we've had a bug report about users having issues when they change the browser user agent (which resulted in orion behaving differently). Ok, I am closing this one for now. Please reopen if you find other places where the editor accesses globals. Thanks! |