Commit graph

22329 commits

Author SHA1 Message Date
Simon Sapin
81b7f046bf Move script_plugins to a single file 2019-09-29 23:20:48 +02:00
Simon Sapin
47c269360c Remove redundant webidl_must_inherit compiler plugin lint
At first I was considering moving it to a procedural macro
(source-level information should be sufficient),
and started by trying to reproduce the error case
by changing `htmldivelement.rs` to use `Element` instead of `HTMLElement`
as the first field.

The output was:

```rust
error[E0308]: mismatched types
   --> /home/simon/servo2/target/debug/build/script-4caa244faca7d10f/out/Bindings/HTMLDivElementBinding.rs:665:31
    |
665 |         let _: &HTMLElement = self.as_parent();
    |                               ^^^^^^^^^^^^^^^^ expected struct `dom::htmlelement::HTMLElement`, found struct `dom::element::Element`
    |
    = note: expected type `&dom::htmlelement::HTMLElement`
               found type `&dom::element::Element`
```

This line number is inside a generated method called `__assert_parent_type`.
As far as I can tell, any case where this lint would error is already caught
by such methods. The lint is therefore redundant and can safely be removed.
2019-09-29 23:11:40 +02:00
Simon Sapin
5b935a60a5 Upgrade to rustc 1.40.0-nightly (084beb83e 2019-09-27) 2019-09-28 12:33:33 +02:00
bors-servo
25501514bd
Auto merge of #24308 - servo:synful, r=SimonSapin
Update a bunch of stuff to syn 1

This updates a lot of our crates to syn 1. Not all of them, but syn 1 was already in tree so it doesn't matter much either way.

<!-- 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/24308)
<!-- Reviewable:end -->
2019-09-27 19:50:29 -04:00
bors-servo
4ade050ed0
Auto merge of #24304 - servo:unsimd, r=nox
Remove use of packed_simd

This crate takes about 40 seconds to build of a fast desktop, and was used in exactly one place. Additionally, that use was previously accidentally disabled (a553964123) and we only noticed more than a year later when the build broke (d1efad6763).

<!-- 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/24304)
<!-- Reviewable:end -->
2019-09-27 18:08:53 -04:00
bors-servo
75c201f78e
Auto merge of #24143 - gterzian:improve_spec_comp_bc_discarding, r=asajeffrey
Improve spec compliance of discarding BCs

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

Came-up at https://github.com/servo/servo/pull/23637#issuecomment-528254988

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

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

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/24143)
<!-- Reviewable:end -->
2019-09-27 12:37:27 -04:00
Anthony Ramine
bceecddb64 Update html5ever to 0.24 2019-09-27 17:43:37 +02:00
Anthony Ramine
1b57558d16 Remove explicit dependency on serde_derive 2019-09-27 17:43:37 +02:00
Anthony Ramine
99ef7813f2 Bump all in-tree components to syn 1 2019-09-27 13:29:55 +02:00
Simon Sapin
d324a2519f Upgrade to rustc 1.40.0-nightly (ddf43867a 2019-09-26) 2019-09-27 13:10:37 +02:00
Anthony Ramine
2d823d7721 Update a bunch of dependencies to versions using syn 1 2019-09-27 12:08:28 +02:00
Anthony Ramine
423cb124ba Restrict syn features for in-tree components 2019-09-27 11:55:38 +02:00
Simon Sapin
4369b4b060 Remove use of packed_simd
This crate takes about 40 seconds to build of a fast desktop,
and was used in exactly one place. Additionally, that use was previously
accidentally disabled (a553964123)
and we only noticed more than a year later when the build broke
(d1efad6763).
2019-09-27 07:34:24 +02:00
bors-servo
5fd4467cb3
Auto merge of #24275 - iinuwa:bugfix/24274, r=jdm
Add check for empty data on ImageData constructor.

<!-- Please describe your changes on the following line: -->
This commit implements the nonzero check for ImageData::new_with_jsobject() according to the ImageData spec.

---
<!-- 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 #24274 (GitHub issue number if applicable)

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

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/24275)
<!-- Reviewable:end -->
2019-09-26 16:05:00 -04:00
Isaiah Inuwa
7cd6a8c682 Refactor constructor code to align with spec. 2019-09-26 13:23:34 -05:00
CYBAI
7432913b7f Remove unused checking
We've supported [Exposed] so no need to check the global scope type!
2019-09-26 22:53:10 +09:00
bors-servo
f12f6546a4
Auto merge of #24294 - servo:missing-feature, r=jdm
Fix error message for invalid combination of style crate feature flags

Instead of ``cannot find value `engine` in this scope`` https://github.com/servo/servo/issues/24284

<!-- 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/24294)
<!-- Reviewable:end -->
2019-09-25 21:11:55 -04:00
bors-servo
5518951143
Auto merge of #24283 - servo:rustup, r=jdm
Upgrade to rustc 1.39.0-nightly (66bf391c3 2019-09-23)

<!-- 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/24283)
<!-- Reviewable:end -->
2019-09-25 13:54:00 -04:00
Simon Sapin
36e53a39bf Fix error message for invalid combination of style crate feature flags
Instead of ``cannot find value `engine` in this scope``
https://github.com/servo/servo/issues/24284
2019-09-25 18:29:52 +02:00
Simon Sapin
d69607064b Upgrade to rustc 1.39.0-nightly (66bf391c3 2019-09-23) 2019-09-25 18:04:35 +02:00
bors-servo
cf725fc3f5
Auto merge of #24261 - paulrouget:fakeMeasureTExt, r=jdm
Temporary implementation of Canvas.MeasureText

@jdm: that will help with the babylonjs demos. Another approach is to implement that in JS and add it to the demos.

<!-- 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/24261)
<!-- Reviewable:end -->
2019-09-25 11:38:36 -04:00
bors-servo
4f45b3bbe1
Auto merge of #24280 - ferjm:webm, r=jdm
Allow playing video/webm on Windows

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

This makes video/webm play on non-UWP Windows. I couldn't find the equivalent gstmatroska.dll on our GStreamer binaries for UWP.

<!-- 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/24280)
<!-- Reviewable:end -->
2019-09-25 07:51:18 -04:00
Paul Rouget
3695fb1eb4 Temporary implementation of Canvas.MeasureText 2019-09-25 13:34:48 +02:00
bors-servo
2be3c2a1af
Auto merge of #23987 - saschanaz:update-webidl, r=jdm
Update WebIDL parser

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

This includes IDL mixin support.

---
<!-- 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 does not fix but helps #22539 / fixes #16244

<!-- Either: -->
- [x] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/23987)
<!-- Reviewable:end -->
2019-09-25 00:59:36 -04:00
bors-servo
e6b271d329
Auto merge of #23873 - RestitutorOrbis:jn-add-tao, r=jdm
Add PerformanceResourceTiming:TimingAllowCheck

Added timing allow check to http_loader.rs in `fn http_network_fetch`.

<!-- 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 #21270

### Things to Do
- [x] Map header values from Timing-Allow-Origin to URL types using [Url::Parse](https://docs.rs/url/2.0.0/url/)
- [x] Check equality of those header URL origin with the origin in question
- [x] Just use url instead of `res.origin`
- [x] Change `.set_attribute(ResourceAttribute::RedirectStart(0))` to `.set_attribute(ResourceAttribute::RedirectStart(RedirectStartValue::Zero))`
- [x] Change `.set_attribute(ResourceAttribute::RedirectEnd(0))` to `.set_attribute(ResourceAttribute::RedirectEnd(RedirectEndValue::Zero))`
- [x] Figure out how to set DomainLookupStart, RequestStart, and ResponseStart without directly passing value as part of enum
- [x] Figure out how to handle lack of DomainLookupEnd (#21260) and SecureConnectionStart (#21268)
- [x] add a flag to ResourceFetchTiming that indicates if the timing check passed, and only update timing attributes if that flag is false
- [x] add function to mark timing test as failed and set all attributes to 0
- [x] resolve compile error regarding move of header_strings variable
- [x] resolve URL parse errors that appear during test execution
- [x] ~~Fix /resource-timing/crossorigin-sandwich-no-TAO.sub.html~~ (Refer to resource_TAO_cross_origin_redirect_chain.html)
- [x] ~~Fix /resource-timing/crossorigin-sandwich-TAO.sub.html~~ (Refer to resource_TAO_cross_origin_redirect_chain.html)
- [x] ~~Fix /resource-timing/resource-reload-TAO.sub.html~~ (Get TIMEOUT, fails on Firefox too?)
- [x] ~~Fix /resource-timing/resource_TAO_cross_origin_redirect_chain.html~~ (Problem seems to lie in loading the iFrame, when the request is made, the URL attached to the PerformanceResourceTiming interface is the initial URL set on the iFrame instead of the URL that is ultimately loaded)
- [x] ~~Fix resource-timing/resource_TAO_multi_wildcard.html~~ (Doesn't work because IMG element doesn't generate HTTP request with Origin field)
- [x] Fix /resource-timing/resource_TAO_match_origin.htm
- [x] Fix /resource-timing/resource_TAO_match_wildcard.htm
- [x] Fix /resource-timing/resource_TAO_multi.htm
- [x] Fix /resource-timing/resource_TAO_wildcard.htm
- [x] Fix /resource-timing/resource_TAO_zero.htm
- [x] Fix /resource-timing/resource_TAO_null.htm
- [x] Fix /resource-timing/resource_TAO_origin.htm (tests for responseStart and domainLookupEnd fail because #21260 and #21271 haven't been resolved)
- [x] Fix /resource-timing/resource_TAO_space.htm
- [x] Fix /resource-timing/resource_TAO_origin_uppercase.htm
- [x] ~~Fix /resource-timing/resource_timing_TAO_cross_origin_redirect.html~~ (Refer to resource_TAO_cross_origin_redirect_chain.html)
- [x] ~~Fix /resource-timing/TAO-case-insensitive-null-opaque-origin.sub.html~~ (TIMEOUT, doesn't seem to parse iFrame SRC correctly? There doesn't seem to be any sign that it makes a request to TAOResponse.py)
- [x] Fix /resource-timing/TAO-crossorigin-port.sub.html
- [x] ~~Fix /resource-timing/TAO-null-opaque-origin.sub.html~~ (Refer to /resource-timing/TAO-crossorigin-port.sub.html)
- [x] /navigation-timing/nav2_test_redirect_chain_xserver_partial_opt_in.html
- [x] /navigation-timing/nav2_test_document_open.html
- [x] /navigation-timing/nav2_test_frame_removed.html
- [x] /performance-timeline/not-clonable.html
- [x] /navigation-timing/nav2_test_redirect_xserver.html
- [x] /resource-timing/resource_connection_reuse.https.html
- [x] /resource-timing/resource_reparenting.html
- [x] /resource-timing/resource_connection_reuse.html
- [x] /resource-timing/resource_script_types.html
- [x] /resource-timing/idlharness.any.html
- [x] /resource-timing/clear_resource_timing_functionality.html
- [x] /resource-timing/idlharness.any.worker.html
- [x] /resource-timing/resource_cached.htm
- [x] /resource-timing/resource_connection_reuse_mixed_content_redirect.html
- [x] /resource-timing/resource_connection_reuse_mixed_content.html
- [x] /resource-timing/resource_timing_buffer_full_when_shrink_buffer_size.html
- [x] /navigation-timing/idlharness.window.html
- [x] /navigation-timing/nav2_test_navigate_iframe.html
- [x] /navigation-timing/nav2_test_navigate_within_document.html
- [x] /resource-timing/resource_reuse.sub.html
- [x] /navigation-timing/nav2_test_instance_accessible_from_the_start.html
- [x] /resource-timing/resource_dedicated_worker.html
- [x] /navigation-timing/unload-event-same-origin-check.html
- [x] /navigation-timing/nav2_test_navigation_type_backforward.html

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

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/23873)
<!-- Reviewable:end -->
2019-09-24 19:11:28 -04:00
bors-servo
5ab2d4ea83
Auto merge of #24217 - tdelacour:ISSUE-23995, r=jdm
ISSUE-23995: lazily generate UniqueIds for Nodes

<!-- Please describe your changes on the following line: -->
Updated `Node` so that its `unique_id` is only generated when `unique_id()` is called. This getter now also has assumed the responsibility for saving the `id` to the global hashset on `ScriptThread`.

Felt like I was fighting the borrow-checker a little bit on this one. Definitely a good learning experience for me, but the result strikes me as a little messy?

---
<!-- 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 #23995 (GitHub issue number if applicable)

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

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/24217)
<!-- Reviewable:end -->
2019-09-24 13:40:38 -04:00
Thomas Delacour
d0c64d347d
ISSUE-23995: lazily generate unique_id for node 2019-09-24 09:25:09 -04:00
Fernando Jiménez Moreno
ea6cff4b8d Allow playing video/webm on Windows 2019-09-24 13:32:15 +02:00
bors-servo
a7f76a3d09
Auto merge of #24255 - ferjm:gst.log.uwp, r=jdm
Hook up GST_DEBUG log to visual studio output

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #23700

<strike>Depends on https://github.com/servo/media/pull/312</strike>

<!-- 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/24255)
<!-- Reviewable:end -->
2019-09-24 03:02:36 -04:00
Isaiah Inuwa
7d7c46cbc9 Add check for empty data on ImageData constructor. 2019-09-23 22:27:30 -05:00
Javed Nissar
f5c2e13359 Expose stub attributes on PerformanceResourceTiming
The purpose of this commit is to expose stub attributes on
PerformanceResourceTiming in order to enable tests to pass as well as
set the type of performance timing entry to navigation when the
initiator is navigation. The purpose of this is to ensure that
document performance entries are correctly classified as navigation
entries rather than resource entries.
2019-09-23 22:52:12 -04:00
bors-servo
6ca62aa0de
Auto merge of #24242 - jdm:xr-webgllayer-format, r=asajeffrey,nox
Fix immersive mode panic on three.js rollercoaster on hololens

We have some special logic about texture formats when creating drawing buffers for WebGL that needs to be shared with the code that creates a separate framebuffer for immersive mode.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #24083 and fix #20595.
- [x] These changes do not require tests because no CI for hololens; tested manually in the emulator.

<!-- 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/24242)
<!-- Reviewable:end -->
2019-09-23 19:34:10 -04:00
bors-servo
ee17eedf3a
Auto merge of #24243 - servo:box-construct, r=SimonSapin
Uncomment more stuff related to box construction

<!-- 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/24243)
<!-- Reviewable:end -->
2019-09-23 17:00:25 -04:00
Anthony Ramine
053a3d5a5a Handle anonymous style in traverse_pseudo_element_contents 2019-09-23 20:32:16 +02:00
Anthony Ramine
0c156c60c2 Handle anonymous style in end_inline_formatting_context 2019-09-23 20:31:43 +02:00
Josh Matthews
ea715a7a4c webgl: Update framebuffer completion status when attached renderbuffer/texture storage changes. 2019-09-23 12:01:08 -04:00
Fernando Jiménez Moreno
558dd8b32d Hook up GST_DEBUG log to visual studio output 2019-09-23 16:58:30 +02:00
Gregory Terzian
45ec250b0a improve spec compliance of discarding BCs
do not handle compositor input events when BC is being discarded

prevent firing of timers for discarded BCs

return null for opener is BC has been discarded

bundle discard BC steps into window method

return null in window.opener, if BC has already been discarded

move the window closed check pre-event to script-thread
2019-09-22 12:46:40 +08:00
bors-servo
b3c2bed84b
Auto merge of #24185 - jdm:uwp-native-build, r=asajeffrey
Fix many WACK errors

These changes ensure that all native dependencies are built with the compiler flags that will prevent forbidden API uses. They also incorporate a fork of rand_os that backports UWP support from more recent rand releases. This is necessary in the short term to avoid having to wait for the entire ecosystem to migrate to the most recent rand release.

Depends on https://github.com/servo/mozjs/pull/200 and https://github.com/servo/rust-mozjs/pull/471.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because no windows WACK tests

<!-- 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/24185)
<!-- Reviewable:end -->
2019-09-20 11:22:02 -04:00
bors-servo
293ccd07e8
Auto merge of #24133 - paulrouget:userAction, r=jdm
Do not allow XR session on non user-activated events

This sets the thread in "user interaction mode" when the dispatched event is trusted. I also tried an approach where we would not rely on the dispatched event but just set "user interaction mode" when we get a compositor event (which, we can assume, are only user generated). That worked as well.

Fixes #23787.

<!-- 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/24133)
<!-- Reviewable:end -->
2019-09-20 06:54:19 -04:00
Paul Rouget
ea7b581537 Do not allow XR session on non user-activated events 2019-09-20 07:52:26 +02:00
Josh Matthews
5bd1e86d42 webxr: Use the same texture format as the original GL context's framebuffer when creating an XR GL layer. 2019-09-20 01:28:22 -04:00
Josh Matthews
778b48fa47 webgl: Implement component narrowing checks for CopyTexImage2D. 2019-09-20 01:28:22 -04:00
Josh Matthews
7e4cf13f5b webgl: Support RGB color attachments for complete framebuffers. 2019-09-20 01:28:22 -04:00
Josh Matthews
46b1d8faee webgl: Report invalid operations for more APIs that can't use an incomplete framebuffer. 2019-09-20 01:28:21 -04:00
Fernando Jiménez Moreno
d7bebce537 Suspend/resume media activity based on document activity 2019-09-19 18:39:36 +02:00
Fernando Jiménez Moreno
51ed44c77d Register pipeline instead of browsing contexts for media instances 2019-09-19 17:48:54 +02:00
Anthony Ramine
9cef3eee65 Uncomment more stuff related to box construction 2019-09-19 11:58:07 +02:00
Anthony Ramine
c08cfbb5f3 Cheat the system and use an Arc in BoxSlot
Ideally we want to be able to borrow from the DOM during box construction
but that's not playing very well at the moment with the current bridge
between script and layout.
2019-09-19 11:24:50 +02:00
Javed Nissar
7596c36959 Move ResourceFetchTiming into Arc
The purpose of this commit is to ensure that the Response object has
access to Timing updates as previously the Response object simply
stored a ResourceFetchTiming struct so updates on ResourceFetchTiming
that were not explicitly done on the Response would not be passed down.
The references to ServoArc are added because Response uses
servo_arc::Arc rather than std::sync::Arc as is used elsewhere. So,
we've switched those other places to servo_arc::Arc instead of switching
Response to std::sync::Arc.
2019-09-18 11:54:28 -04:00