Commit graph

293 commits

Author SHA1 Message Date
Alan Jeffrey
43ca260689 Renamed BrowsingContext to WindowProxy in script. 2017-05-12 15:02:35 -05:00
ddh
2c6bd51bef added origin to globalscope 2017-04-24 13:15:42 +01:00
Imanol Fernandez
0158b5b2af Implement Gamepad API 2017-04-12 15:43:14 +02:00
Sumit
107ac9ab56 Implement basic interface for MutationObserver and MutationRecord. 2017-04-05 01:52:38 -04:00
Fernando Jiménez Moreno
fb878f33d1 Terminate timer scheduler thread during shutdown 2017-03-30 14:27:40 +02:00
Fernando Jiménez Moreno
72d7ee613b Make image cache per-document rather than global 2017-03-27 19:54:13 +02:00
Alan Jeffrey
6bcb5f68be Implement dissimilar-origin window.parent and window.top. 2017-03-17 10:53:20 -05:00
Alan Jeffrey
f9c5d0c117 Implement dissimilar-origin postMessage. 2017-03-15 14:57:25 -05:00
Alan Jeffrey
5348b63e38 Implement setter for document.domain 2017-03-15 10:34:23 -05:00
Alan Jeffrey
1f61a549a3 Added some same-origin-domain checks. 2017-03-14 14:36:03 -05:00
Josh Matthews
dc5335a21e Move checks for document completion to the end of the event loop.
This better reflects the text of the specification - rather than
queuing a task to dispatch the load evnet as soon as the document
loader is unblocked, we want to "spin the event loop until there
is nothing that delays the load event in the Document." Spinning
the event loop is a concept that requires running tasks
completely, hence we check the condition before returning to the
start of the event loop.
2017-03-07 14:02:42 +05:30
Josh Matthews
c890c9143c Make script thread initiate requests for images needed by layout.
In support of this goal, the layout thread collects information about
CSS images that are missing image data and hands it off to the script
thread after layout completes. The script thread stores a list of
nodes that will need to be reflowed after the associated network
request is complete. The script thread ensures that the nodes are
not GCed while a request is ongoing, which the layout thread is
incapable of guaranteeing.

The image cache's API has also been redesigned in support of this
work. No network requests are made by the new image cache, since it
does not possess the document-specific information necessary to
initiate them. Instead, there is now a single, synchronous
query operation that optionally reserves a slot when a cache
entry for a URL cannot be found. This reserved slot is then
the responsibility of the queryer to populate with the contents
of the network response for the URL once it is complete. Any
subsequent queries for the same URL will be informed that the
response is pending until that occurs.

The changes to layout also remove the synchronous image loading
code path, which means that reftests now test the same code
that non-test binaries execute. The decision to take a screenshot
now considers whether there are any outstanding image
requests for layout in order to avoid intermittent failures in
reftests that use CSS images.
2017-02-22 14:19:35 -05:00
Connor Brewster
bfd7b950ad Add ImmutableOrigin to allow for serializing origins 2017-02-22 11:11:59 -06:00
Alan Jeffrey
e8d765557f Allow browsing contexts to resolve to cross-origin windows. 2017-02-16 16:45:29 -06:00
karan sharma
abcd8133de Remove usage of unwrap in handle_exit_pipeline_msg() 2017-02-13 15:55:37 +05:30
Josh Matthews
60d1717eca Remove incorrect uses of asynchronous tasks from ServiceWorker job queue. 2017-02-01 12:54:33 -05:00
Josh Matthews
b5d2bd757b Perform a microtask checkpoint after executing classic scripts and callbacks. 2017-02-01 12:54:33 -05:00
Josh Matthews
32d4f84a30 Generalize promise job queue into solitary microtask queue. 2017-02-01 12:54:33 -05:00
bors-servo
cc2011c050 Auto merge of #15264 - servo:content-type, r=nox
Always set the Document::contentType attribute in ScriptThread::load().

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15264)
<!-- Reviewable:end -->
2017-01-30 05:33:14 -08:00
Ms2ger
69e3173047 Always set the Document::contentType attribute in ScriptThread::load().
There's no good reason to limit this to a few particular content types.
2017-01-30 12:43:49 +01:00
Alan Jeffrey
403499a9d5 Allow windows to share browsing contexts. 2017-01-28 21:57:03 -06:00
Alan Jeffrey
ca9cee084e Fix document.write check for activity. 2017-01-27 17:25:40 -06:00
Alan Jeffrey
a43c842099 The constellation notifies the script thread about documents becoming inactive, active and fully active. 2017-01-27 12:39:43 -06:00
bors-servo
ba7696ebc6 Auto merge of #15220 - nox:kill-parser-pipeline, r=SimonSapin,jdm
Kill ServoParser::pipeline

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15220)
<!-- Reviewable:end -->
2017-01-27 04:19:24 -08:00
Anthony Ramine
d8238646a0 Kill ServoParser::pipeline 2017-01-27 12:12:21 +01:00
bors-servo
cfba589e64 Auto merge of #15242 - servo:refpol, r=nox
Simplify handling of the referrer policy header in ScriptThread::load().

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15242)
<!-- Reviewable:end -->
2017-01-27 02:27:38 -08:00
bors-servo
5af74c38fc Auto merge of #15238 - servo:clip_rect, r=emilio
Remove unused InProgressLoad::clip_rect.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15238)
<!-- Reviewable:end -->
2017-01-27 01:31:47 -08:00
bors-servo
88cd8a3cf0 Auto merge of #15179 - servo:alter_resource_utilization, r=nox
Refactor away ScriptThread::alter_resource_utilization().

It's used in two places, one of which already has access to the Window.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15179)
<!-- Reviewable:end -->
2017-01-26 08:30:56 -08:00
Ms2ger
a689cf1d34 Refactor away ScriptThread::alter_resource_utilization().
It's used in two places, one of which already has access to the Window.
2017-01-26 16:57:00 +01:00
Ms2ger
5b97632132 Simplify handling of the referrer policy header in ScriptThread::load(). 2017-01-26 14:37:11 +01:00
Ms2ger
b9e7aae9a2 Remove unused InProgressLoad::clip_rect. 2017-01-26 12:35:37 +01:00
Anthony Ramine
f1738ee266 Revert "Auto merge of #15136 - nox:mitochondria-finally-makes-it-into-the-tree, r=jdm"
This reverts commit ca6376a714, reversing
changes made to bb24fd3177.
2017-01-24 11:50:43 +01:00
bors-servo
ca6376a714 Auto merge of #15136 - nox:mitochondria-finally-makes-it-into-the-tree, r=jdm
Use mitochondria::OnceCell to store ScriptThread in TLS

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15136)
<!-- Reviewable:end -->
2017-01-23 03:17:33 -08:00
Anthony Ramine
2002de441f Use mitochondria::OnceCell to store ScriptThread in TLS 2017-01-23 12:16:13 +01:00
Anthony Ramine
707f8f881e Make TransitionEvent::new take a &Window 2017-01-21 14:32:34 +01:00
Anthony Ramine
0f244d6948 Mark the page source as loaded only after parsing is done 2017-01-19 16:17:14 +01:00
Anthony Ramine
70ed3e7006 Remove ScriptThread::parsing_complete 2017-01-17 14:24:37 +01:00
bors-servo
2fb9a345d6 Auto merge of #15016 - prampey:doc-deactivate, r=cbrewster
Documents now fully deactivate when a freeze message is sent

<!-- Please describe your changes on the following line: -->
Documents now fully deactivate when a freeze message is sent

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14906  (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because minimal changes.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15016)
<!-- Reviewable:end -->
2017-01-13 14:15:44 -08:00
Prudhvi Rampey
584f72d63b Documents now fully deactivate when a freeze message is sent 2017-01-14 01:12:21 +05:30
Alan Jeffrey
611f3b38a1 Remove reflow status from browsing context. 2017-01-12 15:06:31 -06:00
Imanol Fernandez
c5705bff50 WebVR API Implementation, r=larsbergstrom 2017-01-09 12:44:39 +01:00
Alan Jeffrey
7c2de62124 Implement browsing context discarding. 2017-01-05 21:12:57 +00:00
Alan Jeffrey
78c87ea8d7 Implement discarding Document objects to reclaim space. 2017-01-04 11:29:31 +00:00
bors-servo
885d152e92 Auto merge of #14647 - servo:current-global, r=jdm
Support the 'current' global object.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14647)
<!-- Reviewable:end -->
2016-12-29 01:38:19 -08:00
Emilio Cobos Álvarez
eaf69c29ec
script: Simplify ScriptMemoryFailsafe::drop. 2016-12-25 19:18:29 +01:00
Emilio Cobos Álvarez
755697d6bb
script: Use more idiomatic code for resize handling.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2016-12-25 19:18:24 +01:00
Ms2ger
ec5d08c887 Pass the Document's origin to its constructor.
CC #10963.
2016-12-23 11:15:46 +01:00
Josh Matthews
8ca387c0e0 Warn when a timer event is processed for a discarded document. 2016-12-22 18:56:06 -05:00
bors-servo
0c56499bdc Auto merge of #14589 - servo:harden-script, r=jdm+Ms2ger
Reduce calls into arbitrary code with the ScriptThread::documents borrow held.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14589)
<!-- Reviewable:end -->
2016-12-16 08:53:27 -08:00
Josh Matthews
14d8ae2478 Add a tidy check for problematic match cases in script_thread.rs 2016-12-16 11:52:45 -05:00