Commit graph

517 commits

Author SHA1 Message Date
Davide Giovannini
01c3640e5f fixup! Fixed issue #11651 (Do not fire a blur event when calling .focus() on a focused element) 2016-06-10 11:36:08 +02:00
Davide Giovannini
35aa24eb4c Fixed issue #11651 (Do not fire a blur event when calling .focus() on a focused element) 2016-06-07 20:36:29 +02:00
Anthony Ramine
be334efe2f Fix all the links to the UI Events spec
DOM3Events is no more.
2016-06-04 16:04:35 +02:00
bors-servo
530b5a649e Auto merge of #11468 - rebstar6:refPol4, r=nox
Implement meta referrer policy delivery (3)

<!-- Please describe your changes on the following line: -->

---
<!-- 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 #10311 (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/11468)
<!-- Reviewable:end -->
2016-06-02 21:51:10 -05:00
Rebecca
687d0cd7c3 Add meta-referrer support for documents 2016-06-02 21:48:09 -04:00
Connor Brewster
9980acf2c5 removed unused imports 2016-06-02 16:18:13 -06:00
Keith Yeung
05fc799f92 Clean up DOMManipulationTaskSource 2016-06-02 15:27:08 -04:00
Anthony Ramine
b45f1918d1 Remove JS::from_rooted 2016-05-31 14:43:58 +02:00
Thiago Pontes
766ad5e092 use USVStrings instead of DOMString for urls in Node and Document 2016-05-28 14:53:31 -04:00
bors-servo
3ec20d9cf5 Auto merge of #11472 - jdm:wip, r=mbrubeck
Report blank lines that follow an open brace

This automates something that I find myself frequently commenting on in PRs.

---
<!-- 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] There are tests for these changes OR

<!-- 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/11472)
<!-- Reviewable:end -->
2016-05-27 18:14:25 -05:00
Josh Matthews
3cb8af20c2 Remove empty lines following braces. 2016-05-27 13:32:05 -04:00
Ms2ger
e94f3d4fe0 Remove the LayoutChan type.
It is a pointless abstraction.
2016-05-27 15:33:04 +02:00
bors-servo
2f9796fa69 Auto merge of #11329 - c-rhodes:11320, r=jdm
Report use statements that use {} with only one entry

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 #11320  (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/11329)
<!-- Reviewable:end -->
2016-05-27 07:11:17 -05:00
bors-servo
fb8934a138 Auto merge of #11449 - djc:rm-get-html-element, r=nox
Remove Document.get_html_element() (fixes #8409)

<!-- Please describe your changes on the following line: -->

---
<!-- 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 #8409 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because small refactor

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

Replace uses by calling self.GetDocumentElement(), instead.

<!-- 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/11449)
<!-- Reviewable:end -->
2016-05-27 06:21:36 -05:00
Dirkjan Ochtman
51e2802047 Remove side-effecting map call per review comments 2016-05-27 11:47:32 +02:00
Dirkjan Ochtman
a79f00c337 Use GetDocumentElement() in Document::invalidate_stylesheets() (fixes #8409) 2016-05-27 11:29:09 +02:00
Cullen Rhodes
40acd24e8f Report use statements that use {} with only one entry 2016-05-27 10:18:44 +01:00
Anthony Ramine
34dfc28e98 Move mozbrowser_enabled to util::prefs 2016-05-27 00:55:04 +02:00
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