Commit graph

21464 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
db2f6aa8ca style: Rustfmt + build fix. 2019-05-10 12:43:06 +02:00
Emilio Cobos Álvarez
f429c28f23 style: Add bindings for ArcSlice and ThinArc, and use them to reduce copies of SVG path data.
As I said over bug 1549593, the eventual goal is to use ArcSlice in all
inherited properties. But this seemed like a good first candidate that doesn't
require me to move around a lot more code, since we were already using cbindgen
for the path commands.

Differential Revision: https://phabricator.services.mozilla.com/D30134
2019-05-10 12:43:05 +02:00
Emilio Cobos Álvarez
0d5c4481b8 style: Introduce ArcSlice, a small wrapper over ThinArc but without an explicit header.
We could make the header PhantomData or something, but then we wouldn't be able
to bind to C++, since C++ doesn't have ZSTs. So add a canary instead to add a
runtime check of stuff being sane.

Differential Revision: https://phabricator.services.mozilla.com/D30133
2019-05-10 12:43:04 +02:00
Emilio Cobos Álvarez
2ed2151b3d style: Move OwnedSlice to style_traits.
Differential Revision: https://phabricator.services.mozilla.com/D30126
2019-05-10 12:43:04 +02:00
Emilio Cobos Álvarez
559235edad style: Use the owned slice type for basic shape polygon coordinates.
This enables destructors for tagged unions in cbindgen, implemented in:

 * https://github.com/eqrion/cbindgen/pull/333

Which allow us to properly generate a destructor for the cbindgen-generated
StyleBasicShape (which now contains an OwnedSlice).

For now, we still use the glue code to go from Box<BasicShape> to
UniquePtr<BasicShape>. But that will change in the future when we generate even
more stuff and remove all the glue.

I could add support for copy-constructor generation to cbindgen for tagged
enums, but I'm not sure if it'll end up being needed, and copy-constructing
unions in C++ is always very tricky.

Differential Revision: https://phabricator.services.mozilla.com/D29769
2019-05-10 12:43:03 +02:00
Emilio Cobos Álvarez
330bccd659 style: Add an owned slice type which cbindgen can understand.
Passing these by value won't be ok of course, but that's fine.

I plan to combine this with https://github.com/eqrion/cbindgen/pull/333 to
actually be able to share representation for ~all the things, this is just the
first bit.

Box<T>, Atom and Arc<T> will be much easier since cbindgen can understand them
without issues.

It's boxed slices the only ones I should need something like this. I could avoid
it if I rely on Rust's internal representation, which we can per [1], but then I
need to teach cbindgen all about slices, which is generally hard, I think.

[1]: https://github.com/rust-lang/unsafe-code-guidelines/blob/master/reference/src/layout/pointers.md

Differential Revision: https://phabricator.services.mozilla.com/D29768
2019-05-10 12:43:02 +02:00
Emilio Cobos Álvarez
4b761848a0 style: Remove unnecessary mut usage. 2019-05-10 12:43:01 +02:00
Cameron McCormack
ca756a8550 style: Implement -webkit-line-clamp.
Differential Revision: https://phabricator.services.mozilla.com/D20115
2019-05-10 12:43:00 +02:00
Emilio Cobos Álvarez
81e706469d style: Fix an assertion that doesn't account for alignment padding.
I'm hitting this when trying to add bindings for box shadows, which are 32-bit
aligned.

Differential Revision: https://phabricator.services.mozilla.com/D30353
2019-05-10 12:42:59 +02:00
Emilio Cobos Álvarez
99b97737fe style: Don't panic when creating empty ThinArcs.
The change from [T; 1] to [T; 0] shouldn't change behavior since they have the
right alignment and we never poke at that particular array, but feels more
correct to avoid creating types that point to uninitialized data or outside of
their allocation, now that we allow empty slices.

Differential Revision: https://phabricator.services.mozilla.com/D30352
2019-05-10 12:42:58 +02:00
Emilio Cobos Álvarez
dd6252e34f style: Don't report errors for properties for which we've parsed another value in the same declaration block.
I thought a bit about how to test it and it's not particularly great.
test_css_parse_error_smoketest.html is great to assert that something _gets_
reported, but not that it doesn't :)

Differential Revision: https://phabricator.services.mozilla.com/D30201
2019-05-10 12:42:57 +02:00
Emilio Cobos Álvarez
02210264e7 style: Centralize a bit invalid value error reporting.
Also, buffer the errors, since we're going to want to look at the whole
declaration block to skip reporting them.

This shouldn't change behavior, just moves some work to the caller, and defers a
bit the work so that it happens only when error reporting is enabled.

Differential Revision: https://phabricator.services.mozilla.com/D30200
2019-05-10 12:42:56 +02:00
Emilio Cobos Álvarez
29cecf65b8 style: Use PhantomData<T> in servo_arc.
See https://github.com/rust-lang/rust/pull/60594#issuecomment-489966933

Differential Revision: https://phabricator.services.mozilla.com/D30169
2019-05-10 12:42:55 +02:00
Emilio Cobos Álvarez
1fba297bbc style: ThinArc should use NonNull.
If only for parallelism with Arc<>.

Differential Revision: https://phabricator.services.mozilla.com/D30131
2019-05-10 12:42:53 +02:00
bors-servo
b1b47d8046
Auto merge of #22856 - jdm:angle, r=paulrouget
Add optional ANGLE support to glutin port

Supporting ANGLE in Servo has two important benefits:
* we can actually run Servo instances on our Windows CI machines, which gives us more confidence that we're not breaking it
* we can continue to use OpenGL on devices like the Hololens, rather than creating platform-specific graphical backends

<!-- 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/22856)
<!-- Reviewable:end -->
2019-05-10 00:04:20 -04:00
Josh Matthews
79938affb3 Upgrade mozangle to 0.2 for libEGL.dll. 2019-05-09 15:24:18 -04:00
Josh Matthews
3bfbfa79d9 Add ANGLE support to default embedding. 2019-05-09 15:24:18 -04:00
bors-servo
17590fd48f
Auto merge of #23342 - Manishearth:webrtc-streams, r=ferjm
Receive streams in WebRTC (and MediaStreamTrack support)

This adds the `ontrack` event handler to webrtc, and all the `MediaStreamTrack` stuff necessary to make it work.

WebRTC has the ability to group media tracks into streams using MSIDs, but I haven't yet figured out how to do this. For now, `ontrack` should work.

This _should_ be complete, but it hasn't yet been tested (hence the WIP)

r? @ferjm or @jdm

<!-- 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/23342)
<!-- Reviewable:end -->
2019-05-09 00:26:02 -04:00
Manish Goregaokar
7d5e493759
pref-gate RTCTrackEvent 2019-05-08 19:14:53 -07:00
bors-servo
e39b2b96fe
Auto merge of #23296 - codehag:evaluate-js-fix, r=Manishearth
Enable evaluating javascript in the firefox devtools console

This enables one to use the Firefox Devtools console to evaluate things in servo.

Steps:
start servo: ./mach run tests/html/about-mozilla.html -d --devtools 6000
start firefox and go to Tools -> Web Developer -> Connect...
Set the port to connect to as 6000
Try evaluating things in the console.

<img width="901" alt="Screenshot 2019-05-01 at 13 02 37" src="https://user-images.githubusercontent.com/26968615/57015054-0aa0ce80-6c13-11e9-8031-9299f2da5dba.png">

---
<!-- 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
- [ ] 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/23296)
<!-- Reviewable:end -->
2019-05-08 21:57:19 -04:00
bors-servo
c3a79e8711
Auto merge of #23318 - asajeffrey:magicleap-debugmozjs, r=jdm
Fix magicleap debugmozjs

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

These changes get magicleap servo to compile with `--debugmozjs`.

---
<!-- 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 #23074 and fix #22069
- [X] These changes do not require tests because we're not building debugmozjs servo for magicleap

<!-- 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/23318)
<!-- Reviewable:end -->
2019-05-08 16:04:26 -04:00
Manish Goregaokar
b4ddf6837f Add constructors for MediaStream 2019-05-08 08:15:01 -07:00
Manish Goregaokar
72701d96c4 Add RTCPeerConnection.ontrack 2019-05-08 08:15:01 -07:00
Manish Goregaokar
318c6857a9 Add RTCTrackEvent 2019-05-08 08:15:01 -07:00
Manish Goregaokar
229ce36431 Add {MediaStream, MediaStreamTrack}.clone() 2019-05-08 08:15:01 -07:00
Manish Goregaokar
477ca175e3 Add MediaStream.addTrack() and MediaStream.removeTrack() 2019-05-08 08:15:01 -07:00
bors-servo
ea71b35220
Auto merge of #23325 - emilio:gecko-sync, r=emilio
style: Sync changes from mozilla-central.

See each individual commit for details.

<!-- 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/23325)
<!-- Reviewable:end -->
2019-05-08 07:46:34 -04:00
bors-servo
115a4ac4ff
Auto merge of #23283 - Eijebong:harfbuzz, r=Manishearth
Update harfbuzz to 0.3

`hb_font_funcs_set_glyph_h_kerning_func` is gone but I couldn't find any
replacement. Kerning tests are passing and kerning seems fine on my
computer so I guess it's useless now ?

<!-- 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/23283)
<!-- Reviewable:end -->
2019-05-07 21:15:20 -04:00
Manish Goregaokar
571c3d6d0e Add MediaStream.getTrackById() 2019-05-07 17:09:04 -07:00
Manish Goregaokar
70e1c29ae9 Add MediaStream.getVideoTracks(), MediaStream.getAudioTracks() 2019-05-07 17:09:04 -07:00
Manish Goregaokar
36abbca0a6 Add stream types to tracks, add MediaStreamTrack.id and MediaStreamTrack.kind 2019-05-07 17:09:04 -07:00
Manish Goregaokar
a9ab13b279 Use MediaStreamTracks in MediaStreams 2019-05-07 17:09:04 -07:00
Manish Goregaokar
106cc4a1f7 Add MediaStreamTrack interface 2019-05-07 17:09:04 -07:00
bors-servo
670a32c9e9
Auto merge of #23292 - Manishearth:input, r=asajeffrey
Add support for XRInputSource and target ray spaces

Untested, but compiles.

r? @jdm or @asajeffrey

<!-- 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/23292)
<!-- Reviewable:end -->
2019-05-07 19:23:55 -04:00
Bastien Orivel
6ced81cbf0 Update harfbuzz to 0.3
`hb_font_funcs_set_glyph_h_kerning_func` is gone but I couldn't find any
replacement. Kerning tests are passing and kerning seems fine on my
computer so I guess it's useless now ?
2019-05-07 23:21:46 +02:00
Manish Goregaokar
749a6595ad Update servo-media 2019-05-07 14:09:09 -07:00
bors-servo
cd06c3450e
Auto merge of #23229 - georgeroman:implement_htmlmediaelement_canplaytype, r=ferjm
Finish the implementation of the HTMLMediaElement canPlayType method

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

<!-- 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/23229)
<!-- Reviewable:end -->
2019-05-07 13:57:46 -04:00
codehag
8d8f48242a Introduce EvaluateJSAsync method and evaluationResponse event 2019-05-07 18:16:04 +02:00
Manish Goregaokar
f17f066495 Fix orientation getter in XRRigidTransform 2019-05-07 13:21:42 +02:00
Emilio Cobos Álvarez
1bb15d8819 style: scroll-snap-coordinate shouldn't use NotInitial.
The initial value for this is indeed `none` (and thus empty). The Rust code was
confused.

This property is disabled by default these days, and I think the
get_initial_value() function, which is what could get confused, is not called
for this property, so I think this shouldn't be observable.

Differential Revision: https://phabricator.services.mozilla.com/D30124
2019-05-07 13:01:55 +02:00
Mats Palmgren
0c982dcd16 style: [css-grid-2] Remove single keyword 'subgrid' as a valid value for the 'grid' and 'grid-template' shorthands.
Differential Revision: https://phabricator.services.mozilla.com/D29974
2019-05-07 13:01:05 +02:00
Emilio Cobos Álvarez
0000e4cec2 layout: fix Servo build. 2019-05-07 12:56:10 +02:00
Emilio Cobos Álvarez
561018da7d style: Fix servo build. 2019-05-07 12:56:06 +02:00
Emilio Cobos Álvarez
57874ae90a style: Rustfmt recent changes. 2019-05-07 12:56:02 +02:00
Emilio Cobos Álvarez
deba73a528 Remove a useless MallocSizeOf implementation.
Now that this is no longer used in AuthorStyles there's no point in doing this.
2019-05-07 12:55:59 +02:00
Jeremy Ir
d89e4ad4f3 style: Convert NS_STYLE_BORDER to an enum class in nsStyleConsts.h.
Converting the NS_STYLE_BORDER definitions in to enumerated classes as
per bug 1277133.

The original constants broke the convention used by the rest of the
definitions as the CSS property being described is `border-collapse`,
so corrections were made with the migration to the enumerated class.

Differential Revision: https://phabricator.services.mozilla.com/D29951
2019-05-07 12:55:56 +02:00
Masayuki Nakano
89bf34f46e Move all remaining members of nsIPresShell to mozilla::PresShell
Additionally, this sorts out the order of member variables for minimizing the
instance size.

And also this changes `enum RenderFlags` to `enum class RenderingStateFlags`.

Differential Revision: https://phabricator.services.mozilla.com/D29312
2019-05-07 12:55:49 +02:00
Emilio Cobos Álvarez
627514b737 style: Implement selector-matching for ::part().
Also fairly straight-forward. This may get more complicated when we do part
forwarding, if any.

I've opened https://github.com/w3c/csswg-drafts/issues/3841 in what I think
would be a cleaner model for forwarding.

Differential Revision: https://phabricator.services.mozilla.com/D28063
2019-05-07 12:55:46 +02:00
Emilio Cobos Álvarez
a23ad3be50 style: Add parsing support for ::part().
Disabled for now of course. This should be pretty uncontroversial I'd think.

Differential Revision: https://phabricator.services.mozilla.com/D28060
2019-05-07 12:55:44 +02:00
Emilio Cobos Álvarez
9f73576f6a style: Check iterator length in SelectorIter::is_featureless_host_selector.
I'm going to unconditionally generate the PseudoElement combinator, and this
causes issues since we'll put the raw `::pseudo` selectors in the host bucket,
which is obviously wrong.

Differential Revision: https://phabricator.services.mozilla.com/D27528
2019-05-07 12:55:43 +02:00