Commit graph

19776 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
d12d420974
style: Adjust an assertion to account for the changes from bug 1485930. 2018-09-03 12:32:31 +02:00
Boris Chiou
68ab6217bd
style: Use cbindgen for basic_shape::FillRule.
Just a minor fix to use cbindgen to avoid the conversion between
basic_shape::FillRule and mozilla::StyleFillRule.

Differential Revision: https://phabricator.services.mozilla.com/D4171
2018-09-03 12:32:25 +02:00
Boris Chiou
e46daa09ea
style: Drop the manually implementation of ToCSS for BasicShape::Polygon.
The implementation of ToCSS for Polygon has some rule, and we could use skip_if
to handle and serialization of fill-rule. However, we should derive ToCSS for
the pair of LengthOrPercentages, so define a new type for it.

Differential Revision: https://phabricator.services.mozilla.com/D4153
2018-09-03 12:32:17 +02:00
Xidorn Quan
c587fa3586
style: Make tree pseudo-element prefix not case-sensitive.
Differential Revision: https://phabricator.services.mozilla.com/D4185
2018-09-03 12:32:10 +02:00
Emilio Cobos Álvarez
dceb58664e
style: Remove an assertion that doesn't hold in some cases. 2018-09-03 12:32:05 +02:00
Emilio Cobos Álvarez
86b4b70369
style: Make the counters non-atomic counters and merge afterwards.
This was consistently faster in the benchmark (even when counters were disabled,
which was slightly suspicious, but...).

Anyway, it's not really much code, most of it is FFI copy-pasta.

Differential Revision: https://phabricator.services.mozilla.com/D3874
2018-09-03 12:31:48 +02:00
Emilio Cobos Álvarez
4f04988c13
style: Add a test for the use counters.
Mostly testing that they work, and that they record what we expect them to
record, that is, the actual property that was parsed, and not the properties
that it'd resolve or expand to.

That may be another tricky part for CSSOM, I think style setters would fail an
alias test if implemented with the current setup (we do the property lookup in
C++).

Differential Revision: https://phabricator.services.mozilla.com/D3829
2018-09-03 12:31:41 +02:00
Emilio Cobos Álvarez
89b8f30737
style: Hook the use counters into StyleSheet parsing.
Still not hooked into telemetry, I talked with :janerik and :gfritzsche about
that, but test incoming!

This intentionally doesn't handle CSSOM and such for now, will file followups
for those, though should be trivial.

I want to unify / clean up how we do the use counters and the error reporting
stuff for CSSOM, since the current function call still shows up in profiles,
but that should be a follow-up.

Differential Revision: https://phabricator.services.mozilla.com/D3828
2018-09-03 12:31:33 +02:00
Emilio Cobos Álvarez
c8e5b7f1b0
style: Add a very simple use counter implementation.
As simple as I could make it, for now. We can improve on this.

Differential Revision: https://phabricator.services.mozilla.com/D3827
2018-09-03 12:31:23 +02:00
Emilio Cobos Álvarez
c3a4b27441
style: Remove useless StyleDisplay conversion.
Differential Revision: https://phabricator.services.mozilla.com/D3896
2018-09-03 12:31:18 +02:00
Emilio Cobos Álvarez
ae671a7d26
style: Use a consistent style for longhands.
It's a bit of a mess.

Differential Revision: https://phabricator.services.mozilla.com/D3892
2018-09-03 12:31:10 +02:00
Emilio Cobos Álvarez
a2d6566d0b
style: Make text-orientation, unicode-bidi, contain and will-change non-animatable.
Per recent CSSWG resolutions:

  https://github.com/w3c/csswg-drafts/issues/2737
  https://github.com/w3c/csswg-drafts/issues/2751

Differential Revision: https://phabricator.services.mozilla.com/D3888
2018-09-03 12:31:04 +02:00
Emilio Cobos Álvarez
e338bd3add
style: Serialize clip-path and shape-outside using Servo.
Differential Revision: https://phabricator.services.mozilla.com/D3653
2018-09-03 12:30:57 +02:00
Cameron McCormack
e96b025f10
style: Add MallocSizeOf impls for 128-bit integers.
Differential Revision: https://phabricator.services.mozilla.com/D3947
2018-09-03 12:30:49 +02:00
Boris Chiou
b85c734c41
style: Use macro for path parser.
There are a lot of duplicates, so we use macro to refine them.

Depends on D2963

Differential Revision: https://phabricator.services.mozilla.com/D2966
2018-09-03 12:30:38 +02:00
Boris Chiou
dce2e2927f
style: Define offset-path and implement it in style system.
Define OffsetPath & SVGPathData on the servo-side, and StyleMotion &
StyleSVGPath on the gecko-side. We parse the SVG Path string into a
vector of PathCommand. To build the gfx::Path, we will convert it into
gfx::Path later in a different patch.

The basic flow is:
  - Parse SVG Path String into SVGPathData (in Rust).
  - Use cbindgen to make sure the layout of PathCommand and StylePathCommand, and then set the Box[PathCommand] into nsTArray<StylePathCommand>.
  - Try to convert nsTArray<StylePathCommand> into gfx::Path. (This part will be implemented in a different patch.)

Finally, we use the gfx::Path to create a motion path transform.
The layout implementation is in the later patch.

Depends on D2962

Differential Revision: https://phabricator.services.mozilla.com/D2963
2018-09-03 12:30:21 +02:00
Cameron McCormack
249b865eb8
style: Simplify PropertyDeclarationBlock::get a little.
Depends On D3747

Differential Revision: https://phabricator.services.mozilla.com/D3748
2018-09-03 12:30:12 +02:00
Cameron McCormack
b20bbea033
style: Replace NormalDeclarationIterator return type with impl Trait.
Differential Revision: https://phabricator.services.mozilla.com/D3747
2018-09-03 12:30:01 +02:00
kingdido999
d76ddabba4 Format components dom_struct, domobject_derive and embedder_traits #21373 2018-09-03 08:19:25 +08:00
kingdido999
ad822b74c7 Format components devtools and devtools_traits #21373 2018-09-02 20:29:47 +08:00
kingdido999
ce41c95e05 Format components config #21373 2018-09-02 08:27:07 +08:00
bors-servo
41a2010ee7
Auto merge of #21567 - kingdido999:master, r=jdm
Format components debugger and deny_public_fields #21373

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

```bash
rustfmt components/debugger/*.rs
rustfmt components/deny_public_fields/*.rs
```

<!-- 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/21567)
<!-- Reviewable:end -->
2018-09-01 10:07:05 -04:00
bors-servo
ad865c7156
Auto merge of #21533 - nupurbaghel:current_src, r=jdm
correct currentSrc function

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

---
(recreating PR which got closed earlier https://github.com/servo/servo/pull/21521)
<!-- 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: -->
- [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/21533)
<!-- Reviewable:end -->
2018-09-01 09:03:30 -04:00
Pyfisch
349047b096 Rustfmt layout crate 2018-09-01 13:24:57 +02:00
nupurbaghel
b1adf8ee8a correct failing tests 2018-09-01 08:49:50 +00:00
nupurbaghel
d7cb68cb84 correct currentSrc function 2018-09-01 08:49:49 +00:00
kingdido999
e203cde9be Format components debugger and deny_public_fields #21373 2018-09-01 09:44:53 +08:00
bors-servo
2351872354
Auto merge of #21555 - Manishearth:panner-node-ctor, r=ferjm
Throw errors for invalid values in panner node constructor

This was an oversight in the spec and is being fixed

https://github.com/WebAudio/web-audio-api/issues/1728

r? @ferjm

<!-- 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/21555)
<!-- Reviewable:end -->
2018-08-31 12:25:38 -04:00
Manish Goregaokar
303b62ae8d Throw errors for invalid values in panner node constructor 2018-08-31 05:27:59 -07:00
kingdido999
e4cd04399e Format component compositing #21373 2018-08-31 08:19:22 +08:00
bors-servo
1ee3deea27
Auto merge of #21388 - gterzian:introduce_task_queues, r=jdm
Introduce task queues, and throttling performance timeline tasksource

<!-- 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: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #19997 (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/21388)
<!-- Reviewable:end -->
2018-08-30 14:56:26 -04:00
Gregory Terzian
029715aba6 introduce a generic worker event-loop 2018-08-31 02:10:45 +08:00
Gregory Terzian
ca6306c430 introduce task-queues, and throttling the performance-timeline task-source, in script and worker threads.
queue
2018-08-31 02:10:34 +08:00
bors-servo
6f81ed49f6
Auto merge of #21523 - servo:webgl, r=avadacatavra,jdm
Some more drive-by WebGL fixes and cleanups

<!-- 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/21523)
<!-- Reviewable:end -->
2018-08-30 12:23:31 -04:00
Anthony Ramine
900a19058e Support unions of objects in overloads
Part of #20513, implementing the parts useful for WebGL.
2018-08-30 16:15:40 +02:00
Anthony Ramine
4cf944eab8 Fix gl.isBuffer for buffers that are marked for deletion but still attached 2018-08-30 16:15:39 +02:00
Anthony Ramine
7b673de4d6 Always emit INVALID_OPERATION on null element buffers in drawElements 2018-08-30 16:15:39 +02:00
Anthony Ramine
83e27e4167 Remove WebGLRenderingContext.STENCIL_INDEX 2018-08-30 16:15:38 +02:00
Anthony Ramine
7f9d560f28 Allow binding the null buffer in vertexAttribPointer if offset is 0 2018-08-30 16:15:38 +02:00
Anthony Ramine
0ba66f9f12 Fix the error for invalid arrays passed to gl.vertexAttrib*v() 2018-08-30 16:15:38 +02:00
bors-servo
4dc8bdeb61
Auto merge of #21536 - servo:rustup, r=SimonSapin
Upgrade to rustc 1.30.0-nightly (7061b2775 2018-08-28)

<!-- 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/21536)
<!-- Reviewable:end -->
2018-08-30 10:10:49 -04:00
kingdido999
f472d05003 Format components canvas and canvas_traits #21373 2018-08-30 11:24:39 +08:00
Simon Sapin
707df85a82 Upgrade to rustc 1.30.0-nightly (7061b2775 2018-08-28) 2018-08-29 14:53:19 +02:00
Anthony Ramine
cb2f83cf8e Fix Drop assertion for WebGLBuffer
A buffer that is dropped may not have been marked for deletion but it
must not be attached to any VAO.
2018-08-29 02:05:49 +02:00
Simon Sapin
a6dcfdcd55 Upgrade to rustc 1.30.0-nightly (721913067 2018-08-26) 2018-08-27 10:47:49 +02:00
Gregory Terzian
7b8d903d57 fire error when placeholder image is loaded 2018-08-26 19:06:16 +08:00
bors-servo
f2306c8e19
Auto merge of #21516 - servo:bindgenup, r=SimonSapin
Update bindgen to 0.39.0

This fixes a build error for i686-linux-android with some versions of libclang:

```rust
error[E0560]: struct `generated::root::JS::Value` has no field named `__bindgen_align`sys
  --> /home/simon/projects/mozjs/src/jsval.rs:83:2
   |
83 |     __bindgen_align: [],
   |     ^^^^^^^^^^^^^^^ `generated::root::JS::Value` does not have this field
   |
   = note: available fields are: `data`

error: aborting due to previous error
```

<!-- 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/21516)
<!-- Reviewable:end -->
2018-08-24 20:50:44 -04:00
bors-servo
d827370804
Auto merge of #21502 - Manishearth:listener, r=ferjm
Add AudioListener/AudioPanner DOM interfaces

Seems to work.

I'll need some changes to the servo-media side to support the panner
node getters as well as the older `setPosition()`/etc APIs. I'll get to
those later.

r? @ferjm

<!-- 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/21502)
<!-- Reviewable:end -->
2018-08-24 19:13:05 -04:00
Manish Goregaokar
5dd830344b Handle channel count constraints in panner constructor 2018-08-24 12:51:37 -07:00
Manish Goregaokar
58176c4148 Add some checks in PannerNode accessors 2018-08-24 12:51:37 -07:00