Commit graph

499 commits

Author SHA1 Message Date
Ms2ger
4113eb6f72 Remove the script listener thread (fixes #11345).
We needed a separate thread in the chrome process because communication to the
compositor is done through a trait object, and cross-process virtual calls are
forbidden.

Also, the fact that these messages are ultimately handled by the compositor is
an implementation detail; conceptually, the relevant constellation is supposed
to handle these messages.

So instead, the script thread will now send the messages to the constellation,
which will ask the compositor to handle them.
2016-05-25 12:50:22 +02:00
Ms2ger
a5139787de Stop storing CSS errors on the Document.
They are never read.
2016-05-24 14:41:38 +02:00
Anthony Ramine
cdc7bca944 Move DOMString back to script
This entirely removes the 'non-geckolib' feature of the util crate.
2016-05-24 10:54:57 +02:00
bors-servo
ef81e6982a Auto merge of #11338 - Ms2ger:compositor-refcell, r=nox
Take ScriptThread::compositor out of its RefCell.

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 --faster` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

Either:
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because refactoring

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

There's no reason for it; IpcSender::send takes &self.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11338)
<!-- Reviewable:end -->
2016-05-23 19:16:12 -07:00
Anthony Ramine
1e9be028cf Use a simple Vec for the animation frame list
Adding an animation frame list is now just pushing a new pair onto the vector,
while canceling one is setting its callback to None.

This means we can't send NoAnimationCallbacksPresent anymore to the constellation
when all entries were cancelled, but I'm not sure that's very important anyway.

The good downside of this change is that when running the callbacks, if no
new one was queued during their execution, we can just swap back the original Vec
into the Document in run_the_animation_frame_callbacks, thus reusing the
original allocation.
2016-05-23 12:11:58 +02:00
Ms2ger
2b014befd0 Take ScriptThread::compositor out of its RefCell.
There's no reason for it; IpcSender::send takes &self.
2016-05-23 11:31:18 +02:00
bors-servo
1a34137ac4 Auto merge of #10961 - creativcoder:custom_response_iface, r=jdm
adding interface for custom responses

Fixes #10960

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10961)
<!-- Reviewable:end -->
2016-05-21 01:12:54 -07:00
bors-servo
5fc511a40e Auto merge of #11255 - s-baldrick:11158, r=ConnorGBrewster
11158 - add event handlers

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 --faster` does not report any errors
- [X] These changes fix #11158 (github issue number if applicable).

Either:
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because ____

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="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11255)
<!-- Reviewable:end -->
2016-05-20 21:26:41 -07:00
Piotr Stankiewicz
d1af39c114 dom: Add missing event handlers
Adding:
* global event handlers,
* window event handlers,
* document and element handlers,
* and support for BeforeUnloadEvent.

Signed-off-by: Piotr Stankiewicz <bionicrift@gmail.com>
2016-05-20 18:25:13 +01:00
Rahul Sharma
3766cd1673 adding interface for custom responses 2016-05-20 12:11:56 +05:30
Zhen Zhang
a51db4cfa8 Implement trait-based ResourceThreads and clean up related naming issues
Changes include:

- Introduce an IpcSend trait to abstract over a collection of IpcSenders
- Implement ResourceThreads collection to abstract the resource-related
  sub threads across the component
- Rename original ResourceThread and ControlMsg into an unifed CoreResource__
  to accommodate above changes and avoid confusions
2016-05-20 08:00:16 +08:00
Ms2ger
cc2b2b50a7 Remove ConstellationChan.
It's a pointless abstraction that propagates the obsolete chan terminology,
swaps the order in which the sender and receiver are returned, and hides a
source of panics.
2016-05-19 17:13:44 +02:00
Patrick Walton
8a83261b61 script: Avoid needless ChangeRunningAnimationsState messages during
typical `requestAnimationFrame()` animations.

This skips useless message traffic when `requestAnimationFrame()` is
called during an animation frame callback. It reduces CPU usage of the
following snippet by 49%:

    <script>
        function foo() {
            requestAnimationFrame(foo);
        }
    </script>
    <button onclick="foo()">Start rAF</button>

Partially addresses #9844.
2016-05-17 10:24:53 -07:00
Per Lundberg
2f7ed1d73e Removed unused imports
This fixes #11185.
2016-05-15 22:24:26 +03:00
Connor Brewster
11dd0d7c46 add popstateevent, hashchangeevent, pagetransitionevent 2016-05-11 22:11:46 -06:00
bors-servo
a76db9af54 Auto merge of #11051 - mrmiywj:closeevent-argument, r=Ms2ger
'closeevent' argument for Document::createEvent

Add "close event" argument for Document::createEvent
Fixes #10737

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11051)
<!-- Reviewable:end -->
2016-05-09 00:48:41 -07:00
mrmiywj
dfaad2dab2 'closeevent' argument for Document::createEvent
fix alphabetical order

delete unused tests
2016-05-08 14:40:12 +08:00
bors-servo
17ba9fb5da Auto merge of #10821 - askeing:fix_10782, r=jdm
Checking the browsing_context before change title

fix #10782

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10821)
<!-- Reviewable:end -->
2016-05-06 14:20:45 -07:00
askeing
3c56d41699 Checking the browsing_context before change title, and adding wpt test 2016-05-05 14:12:03 +08:00
bd339
0c92e19e84 make scripting_enabled depend on a browsing context 2016-05-01 14:06:02 +02:00
Ms2ger
897be5f6ee Reduce channel cloning. 2016-04-29 14:55:52 +02:00
Ms2ger
703d018f23 Avoid some clones. 2016-04-29 14:55:49 +02:00
Keith Yeung
33acb1937c Remove extraneous script_chan parameter from Trusted::new 2016-04-28 10:52:44 +02:00
SunyDays
7d24426172 Implement the errorevent argument to Document::createEvent 2016-04-27 20:49:25 +03:00
bors-servo
5fd93de7be Auto merge of #10866 - broesamle:issue10856-a, r=Ms2ger
Move abstract parser infrastructure from servohtmlparser.rs to parse

Fixes #10856

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10866)
<!-- Reviewable:end -->
2016-04-27 03:29:50 -07:00
Martin Broesamle
7c4489b193 Move abstract parser infrastructure from servohtmlparser.rs to parse 2016-04-27 10:32:59 +02:00
SunyDays
e4f3a31caf Implement the focusevent argument to Document::createEvent 2016-04-27 01:51:48 +03:00
Stephen (Ziyun) Li
889579c6de
Implement the "progressevent" argument to Document::createEvent 2016-04-26 00:32:50 -04:00
bors-servo
34900814fc Auto merge of #10696 - rebstar6:referrerPolicy, r=jdm
Referer header

PR1 for https://github.com/servo/servo/issues/10311

This puts the code and data structures in place to set the Referer header based on the Referrer Policy for a given document. Note that document:: get_referrer_policy() always returns the 'No Referrer' option, so for now, this should have no impact on production code, and that policy requires that the Referer header is not added.

Later PRs will determine the policy and edit that get_referrer_policy() accordingly.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10696)
<!-- Reviewable:end -->
2016-04-25 13:52:01 -07:00
Rebecca
526525b835 Add referrer policy pass-through and referrer header logic
add pass-through from doc to http-loader for referrer_policy, ref_URL
add logic for setting referer header
add script pass-through for referrer
add unit tests for setting referer header
2016-04-25 16:41:06 -04:00
Maciej Skrzypkowski
6187ee631b "storageevent" argument for Document::createEvent
Fixes  #10736
2016-04-25 12:02:05 +02:00
bors-servo
59205323da Auto merge of #10805 - tylersouthwick:webglcontextevent, r=Ms2ger
implement webglcontextevent

fixes #10742

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10805)
<!-- Reviewable:end -->
2016-04-25 01:50:52 -07:00
bors-servo
4b8f1260b9 Auto merge of #10814 - SunyDays:svgevents_argument, r=Ms2ger
Implement the svgevents argument to Document::createEvent

close #10741

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10814)
<!-- Reviewable:end -->
2016-04-24 22:49:26 -07:00
SunyDays
bb19e7d3ac Implement the svgevents argument to Document::createEvent 2016-04-24 20:51:06 +03:00
Simon Sapin
7932ab6ac2 Upgrade to rust-url 1.0 and hyper 0.9 2016-04-23 20:27:58 +02:00
Tyler Southwick
cba0267ed4 implement webglcontextevent 2016-04-22 19:54:13 -07:00
Tetsuharu OHZEKI
b4cf3b802e Drop support for keyevents in Document::createEvent 2016-04-21 11:04:00 +09:00
Ms2ger
03d4bacc05 Use num-traits in script. 2016-04-20 15:23:43 +02:00
Rizky Luthfianto
5ad312cb8e Fix Document#elementFromPoint no viewport available test 2016-04-16 17:16:27 +07:00
Rizky Luthfianto
5a3ce597d3 Fix Document#elementsFromPoint no viewport available test 2016-04-16 01:05:32 +07:00
Simon Sapin
6889f37d9e Remove the url! plugin.
In rust-url 1.0 the `Url` struct is going to have private fields, and there
is no way to to create an aribitrary one without going through the parser.

The plugin never had a clear demonstrated performance benefit,
it was made mostly because it was possible and relatively easy at the time.
2016-04-14 15:35:28 +02:00
Josh Matthews
90454c279d Use origin when manipulating cookies. 2016-04-13 12:07:05 +02:00
Josh Matthews
fa42b452a0 Use origin for document.domain. 2016-04-13 12:07:04 +02:00
Josh Matthews
a8233a135e Implement origin concept. 2016-04-13 10:37:55 +02:00
Zhen Zhang
7169a08a34 fix performance timing precision and navigation_start unit; add LoadEventStart and LoadEventEnd timing 2016-04-13 01:30:02 +08:00
Corey Farwell
11a3ce1257 Remove get_* on getters as per RFC 0344.
https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md#gettersetter-apis

https://github.com/servo/servo/issues/6224
2016-04-10 22:49:35 -04:00
shubham_jain
6626c5cfd4 issue #10141 : Document::location set null for documents without a browsing context. r=Ms2ger 2016-04-09 22:54:07 +05:30
Rahul Sharma
2caa9a2a76 refactors entities from script_thread into script_runtime 2016-04-06 12:46:49 +05:30
Paul Rouget
df6e7394d4 forcetouch events support
This enables Apple forcetouch DOM events. It requires the preference dom.forcetouch.enabled.

The DOM events are described here:
- https://developer.apple.com/library/mac/documentation/AppleApplications/Conceptual/SafariJSProgTopics/RespondingtoForceTouchEventsfromJavaScript.html

The Cocoa mechanism is documented here:
- 20000016-SW274
2016-04-05 18:42:28 +08:00
bors-servo
b568b72d76 Auto merge of #10391 - autrilla:inline-content-changed, r=Ms2ger
Inlined content_changed

cc @Ms2ger

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10391)
<!-- Reviewable:end -->
2016-04-05 01:37:55 +05:30