Commit graph

19869 commits

Author SHA1 Message Date
Anshul Malik
ce9231c471 format components/profile_traits 2018-09-10 09:56:01 +05:30
bors-servo
6cb39fad47
Auto merge of #21620 - chansuke:format_style_traits, r=jdm
Format component of style_traits

<!-- Please describe your changes on the following line: -->
Format `style_traits` with:
```
rustfmt components/style_traits/*.rs
```

---
<!-- 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 part of #21373.
- [x] These changes do not require tests because they format the components only.

<!-- 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/21620)
<!-- Reviewable:end -->
2018-09-09 16:18:18 -04:00
bors-servo
129b97ad08
Auto merge of #21648 - kingdido999:master, r=jdm
Format gfx_traits and hashglobe #21373

```bash
rustfmt components/gfx_traits/*.rs
rustfmt components/hashglobe/src/*.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/21648)
<!-- Reviewable:end -->
2018-09-09 13:34:03 -04:00
bors-servo
c8fd63802e
Auto merge of #21652 - chansuke:format_style, r=emilio
Format component `style`

<!-- Please describe your changes on the following line: -->
Format `components/style` with:
```
rustfmt components/style/*.rs
```

---
<!-- 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 part of #21373.
- [x] These changes do not require tests because they format the components only.

<!-- 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/21652)
<!-- Reviewable:end -->
2018-09-09 12:40:12 -04:00
bors-servo
186393a3be
Auto merge of #21646 - servo:webgl, r=jdm
Fix some texture conversions

<!-- 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/21646)
<!-- Reviewable:end -->
2018-09-09 11:52:22 -04:00
chansuke
8dab4d659a
Format style component. 2018-09-09 16:24:45 +02:00
Boris Chiou
31fc6cd565
style: Use the standalone struct and enum for the flags in SVG path.
We define the standalone types for using derive macro easily and overriding
the behaviors of this traits. This could avoid defining the general
behavior of booleans.

Depends on D4788

Differential Revision: https://phabricator.services.mozilla.com/D4813
2018-09-09 16:09:08 +02:00
Boris Chiou
b0604c9be5
style: Make offset-path: path() animatable.
Here, we change the animation type of offset-path as ComputedValue, so
we could do animation on it. Also enable the wpt for offset-path
interpolation. In test_transition_per_property.html, we add some basic tests
ifor offset-path.

ToAnimatedZero for PathCommand will be dropped later.

Because the animations of arcs with mismatched flags are fallen back to
discrete animations, the result of getComputedValue is not normalized in this
case. This makes some wpt failed even though the progress is 100%.

Depends on D4786

Differential Revision: https://phabricator.services.mozilla.com/D4787
2018-09-09 16:08:56 +02:00
Boris Chiou
14911b96e0
style: Make SVGPathData and clip-path: path() animatable.
Implement Animate trait for SVGPathData.

The basic idea is: we normalize |this| and |other| svg paths, and then
do interpolation on the normalized svg paths. The normalization is to
convert relative coordinates into absolute coordinates, so we could do
real number interpolation on each path command directly.

In this patch, we also make |clip-path:path()| animatable.

Differential Revision: https://phabricator.services.mozilla.com/D4786
2018-09-09 16:08:24 +02:00
Anthony Ramine
6d3609dbe8 Fix the UNSIGNED_SHORT_4_4_4_4 case of premultiply_pixels 2018-09-09 12:22:01 +02:00
Anthony Ramine
d8b7394fa3 Fix the UNSIGNED_SHORT_5_5_5_1 case of premultiply_pixels 2018-09-09 12:21:56 +02:00
Anthony Ramine
f726f18291 Remove some useless argument mutability
I wonder why this doesn't trigger a warning.
2018-09-09 12:21:55 +02:00
Anthony Ramine
e61c7b757f Fix the LUMINANCE of rgba8_image_to_tex_image_data
The internal format and format values match, thus the canvas or image input
must be interpreted as already in LUMINANCE format.
2018-09-09 12:21:54 +02:00
Anthony Ramine
9a362391d5 Fix the LUMINANCE_ALPHA case of rgba8_image_to_tex_image_data
The internal format and format values match, thus the canvas or image input
must be interpreted as already in LUMINANCE_ALPHA format.
2018-09-09 12:21:54 +02:00
kingdido999
951bda3600 Format hashglobe #21373 2018-09-09 10:14:36 +08:00
kingdido999
2c9e32a09e Format gfx_traits #21373 2018-09-09 10:11:08 +08:00
bors-servo
9c1c58a498
Auto merge of #21643 - servo:webgl, r=jdm
Reuse the input vector in more cases of rgba8_image_to_tex_image_data

<!-- 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/21643)
<!-- Reviewable:end -->
2018-09-08 13:18:08 -04:00
Anthony Ramine
74e6f40abe Reuse the input vector in more cases of rgba8_image_to_tex_image_data 2018-09-08 18:21:45 +02:00
Anthony Ramine
6a692228fc Fix the ALPHA/FLOAT case of rgba8_image_to_tex_image_data
I'm pretty sure this is supposed to write the ALPHA component.
2018-09-08 18:06:51 +02:00
bors-servo
5929086c36
Auto merge of #21641 - servo:webgl, r=jdm
Some drive-by perf improvements on the WebGL stack

This avoids a bunch of pointless buffer and texture copies, but is far from eliminating all which could be eliminated.

<!-- 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/21641)
<!-- Reviewable:end -->
2018-09-08 10:33:21 -04:00
Anthony Ramine
e192e4d97f Reuse input of rgba8_image_to_tex_image_data in some cases 2018-09-08 13:42:07 +02:00
Anthony Ramine
27951bb7c8 Make rgba8_image_to_tex_image_data not overallocate in some case 2018-09-08 13:42:07 +02:00
Anthony Ramine
145086e150 Make rgba8_image_to_tex_image_data a free-standing function 2018-09-08 13:42:06 +02:00
Anthony Ramine
a5f9d03229 Make remove_premultiplied_alpha mutate its input 2018-09-08 13:42:06 +02:00
Anthony Ramine
1864edbb36 Make premultiply_pixels mutate its input 2018-09-08 13:42:06 +02:00
Anthony Ramine
4bd8efa49e Use byte channels to send textures to the WebGL thread 2018-09-08 13:42:06 +02:00
Anthony Ramine
408e540c55 Use ipc::bytes_channel in ReadPixels 2018-09-08 13:42:06 +02:00
Anthony Ramine
4e9281dcbf Simplify WebGLRenderingContext::get_image_data 2018-09-08 13:42:06 +02:00
kingdido999
c0da829e33 Reorder gfx lib creates 2018-09-08 14:24:56 +08:00
chansuke
a2fc2ae517 Format component of style_traits 2018-09-08 13:28:13 +09:00
kingdido999
3a3c4b8c8e Format the rest of gfx #21373 2018-09-08 08:05:42 +08:00
bors-servo
f7630dad87
Auto merge of #21630 - kingdido999:master, r=jdm
Format gfx text #21373

```bash
rustfmt $(find components/gfx/text -type f -name "*.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/21630)
<!-- Reviewable:end -->
2018-09-07 11:20:11 -04:00
chansuke
25bc998f17 Format component of style_derive 2018-09-07 22:18:51 +09:00
bors-servo
51283cf77a
Auto merge of #21634 - servo:webgl, r=emilio
Use a bytes channel in BufferData

<!-- 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/21634)
<!-- Reviewable:end -->
2018-09-07 06:23:12 -04:00
Anthony Ramine
9f924013bc Use a bytes channel in BufferData
This means we don't need to copy the input ArrayBuffer at all on the DOM side.
2018-09-07 11:28:59 +02:00
Anthony Ramine
e37856a855 Remove Clone impl for WebGLMsg 2018-09-07 11:28:45 +02:00
Anthony Ramine
1293692ef8 Simplify WebGLBuffer::buffer_data
There is no need to pass the target to that buffer method, given the buffer
has been retrieved by looking up the one bound to that target in the context.
2018-09-07 11:28:11 +02:00
kingdido999
aa4a8eb88d Format gfx text #21373 2018-09-07 10:49:07 +08:00
bors-servo
41a6c0cc39
Auto merge of #21610 - kingdido999:master, r=jdm
Format gfx platform #21373

```bash
rustfmt $(find components/gfx/platform -type f -name "*.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/21610)
<!-- Reviewable:end -->
2018-09-06 20:56:50 -04:00
bors-servo
1343c7de50
Auto merge of #21560 - JacksonCoder:chunk-file, r=jdm
Read file URL in chunks

<!-- Please describe your changes on the following line: -->
This is a very straightforward PR: essentially, I replaced a `read_to_end` call that occurs when processing a file URL fetch with a loop that reads the file in chunks (with a `FILE_CHUNK_SIZE` constant that specifies the chunk size, which I've put at 32KB), and then calls `target.process_response_chunk` to process the chunk. The chunk is then appended to the fetch result, and once the end of the file is reached, the result is returned.

---
<!-- 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 #21466.

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because there isn't really a way to observe this.

<!-- 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/21560)
<!-- Reviewable:end -->
2018-09-06 19:52:16 -04:00
Jackson Lewis
430ba86668 Tidy things up 2018-09-06 16:09:35 -07:00
Anthony Ramine
5a206d5137 Make validate_framebuffer return a WebGLResult<()> 2018-09-06 11:25:22 +02:00
Anthony Ramine
0579fbe4fa Use WebGLResult for returns of instanced draw methods 2018-09-06 10:41:58 +02:00
bors-servo
af777fcf15
Auto merge of #21623 - emilio:gecko-sync, r=emilio
style: Sync changes from mozilla-central.

See each commit for details.

https://bugzilla.mozilla.org/show_bug.cgi?id=1488854

<!-- 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/21623)
<!-- Reviewable:end -->
2018-09-05 16:32:19 -04:00
Emilio Cobos Álvarez
6dcf9b7630
style: Use decomposition to interpolate matched perspective transform operations.
Looks like this produces sensible results for interpolation with 0, though I'm
not really convinced about the results from, let's say, 1px to 2000px in the
attached test-case, I would've expected a linear interpolation from that to go
through normal length interpolation.

css-transforms-1 says:

  > Two transform functions with the same name and the same number of arguments
  > are interpolated numerically without a former conversion. The calculated
  > value will be of the same transform function type with the same number of
  > arguments.
  >
  > Special rules apply to <matrix()>.

Which is what we do... I was going to file a spec issue but turns out that it's
already addressed in css-transforms-2:

  https://drafts.csswg.org/css-transforms-2/#interpolation-of-transform-functions

Which says:

  > The transform functions <matrix()>, matrix3d() and perspective() get
  > converted into 4x4 matrices first and interpolated as defined in section
  > Interpolation of Matrices afterwards.

Differential Revision: https://phabricator.services.mozilla.com/D4942
2018-09-05 19:11:26 +02:00
Emilio Cobos Álvarez
3e0250ae61
style: Only no-op visited <-> unvisited changes.
Other changes should really be (and are) indistinguishable.

Differential Revision: https://phabricator.services.mozilla.com/D4847
2018-09-05 19:11:18 +02:00
Boris Chiou
cf6215c85f
style: Add a pref for |clip-path:path()|.
Add a preference, layout.css.clip-path-path.enabled, for |clip-path:path()|.

Differential Revision: https://phabricator.services.mozilla.com/D4965
2018-09-05 19:11:12 +02:00
Emilio Cobos Álvarez
3f08d2cc02
style: Make the author styles disabled stuff actually disable style attribute, animations, and XBL rules.
This also removes one of my FIXMEs from when I was looking at this code.

We don't seem to have a pre-existing test for this feature, sigh. I'll try to
write one if I have cycles for it...

Note that it not applying XBL rules is a feature, given the current state of
affairs. Video controls and such are right now unusable with no styles enabled.

Differential Revision: https://phabricator.services.mozilla.com/D4795
2018-09-05 19:10:46 +02:00
Emilio Cobos Álvarez
0c0018e4d6
style: Make <svg:use> in shadow tree apply the rules from the originating tree.
Differential Revision: https://phabricator.services.mozilla.com/D4674
2018-09-05 19:10:37 +02:00
chansuke
812d4a479a Format component of url 2018-09-05 22:53:03 +09:00