Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differentiate between associated windows and real document views #1073

Closed
jdm opened this issue Oct 16, 2013 · 8 comments
Closed

Differentiate between associated windows and real document views #1073

jdm opened this issue Oct 16, 2013 · 8 comments
Labels

Comments

@jdm
Copy link
Member

@jdm jdm commented Oct 16, 2013

#1072 is getting rid of optional windows, since we require them in order to access the JSContext everywhere. However, a newly parsed Document obtained via DOMParser should have a null defaultView, so we need a way to reflect that.

@Ms2ger
Copy link
Contributor

@Ms2ger Ms2ger commented Oct 16, 2013

@bholley probably has thoughts on how we deal with JSContexts. As for the scope, we might want a more general global object rather than requiring a Window (so we don't have to rewrite everything for workers).

@bholley
Copy link
Contributor

@bholley bholley commented Oct 16, 2013

The JSContext should live on the runtime. JSContexts are going away soon in SM. Conceptually, they should be 1-to-1 with JSRuntimes in servo.

@jdm
Copy link
Member Author

@jdm jdm commented Oct 16, 2013

We've got code right now that sets the private field of a JSContext to a pointer to the associated Page right now, so that will need some consideration in the presence of iframes and such.

@bholley
Copy link
Contributor

@bholley bholley commented Oct 16, 2013

OMGNO! We should not be doing that. I've been working on getting rid of that nonsense from Gecko for over a year now.

How easy is it to rip out? What do we need it for?

@jdm
Copy link
Member Author

@jdm jdm commented Oct 16, 2013

http://mxr.mozilla.org/servo/search?string=page_from_context
In the codegen, the Page is used to store references to proxy handlers and other necessary data, and we grab the Window reference via it. Everywhere else, it looks like we use it to obtain the window object for GetParentObject. As I remarked on IRC, we can probably do something like JS_GetGlobalForObject on a given reflector and unwrap that to Window, giving us our global reference as well as a reference to the Page as well.

@jdm
Copy link
Member Author

@jdm jdm commented Apr 15, 2014

The great JSContext scare is behind us, and they're 1:1 with runtimes.

ChrisParis pushed a commit to ChrisParis/servo that referenced this issue Sep 7, 2014
Nit/style clean-up for first round of merged TTWF Seoul PRs merges.
@jdm
Copy link
Member Author

@jdm jdm commented Feb 5, 2015

Related: #4806

@Ms2ger
Copy link
Contributor

@Ms2ger Ms2ger commented May 27, 2016

Fixed in #9603.

@Ms2ger Ms2ger closed this May 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.