Commit graph

2379 commits

Author SHA1 Message Date
bors-servo
33766b2714 Auto merge of #17348 - emilio:bup, r=bholley
style: Inline RestyleData.

Bug: 1368236
MozReview-Commit-ID: 49s3SO0PMHf

<!-- 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/17348)
<!-- Reviewable:end -->
2017-06-15 20:28:56 -07:00
Emilio Cobos Álvarez
ffc45e9aaa
style: Inline RestyleData.
Bug: 1368236
MozReview-Commit-ID: 49s3SO0PMHf
2017-06-16 03:36:18 +02:00
Anthony Ramine
608e7f71a2 Make computed types hold Percentage instead of bare CSSFloat 2017-06-15 16:59:03 +02:00
Bobby Holley
d5fb93d487 Bump rayon to 0.8.
MozReview-Commit-ID: 8OFE5PghMzl
2017-06-14 18:52:05 -07:00
Nicolas Silva
997608f11f Make BaseFlow::stacking_relative_position a vector. 2017-06-14 16:01:01 +02:00
Nicolas Silva
8617320500 Bump euclid to 0.14. 2017-06-14 16:00:59 +02:00
Anthony Ramine
d55d726a21 Derive ToCss for cursor keywords 2017-06-08 11:20:40 +02:00
bors-servo
24e944ad94 Auto merge of #17219 - upsuper:currentcolor, r=Manishearth,birtles
Support interpolation between currentcolor and numeric color

This is the Servo side change of [bug 1345709](https://bugzilla.mozilla.org/show_bug.cgi?id=1345709).

<!-- 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/17219)
<!-- Reviewable:end -->
2017-06-07 21:03:52 -07:00
Xidorn Quan
c62935577a Add separate computed Color value. 2017-06-08 12:59:26 +10:00
bors-servo
c0f3ec8780 Auto merge of #17192 - mbrubeck:layout, r=pcwalton
Parallel layout optimizations

This takes some of the optimizations made to parallel styling in #16971 and applies them to parallel layout.  Specifically:

* Reduce the chunk size, to increase chances for parallelism on trees with small fan-out.
* Reduce allocations by using SmallVec.
* Reduce task switching by processing up to one chunk of children within the same rayon task as the parent.

This cuts the "Primary Layout Pass" time in **half** on the MySpace page from [tp5n], and on my other real-world test pages it is a small improvement or close to no change.

[tp5n]: https://wiki.mozilla.org/Buildbot/Talos/Tests#tp5n_pages_set

---
- [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 they affect performance only

<!-- 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/17192)
<!-- Reviewable:end -->
2017-06-07 19:57:57 -07:00
Xidorn Quan
bf77f81ed6 Create RGBAColor for colors compute to RGBA. 2017-06-08 10:42:26 +10:00
Alan Jeffrey
fd17dcd604 Implemented the plumbing for paint worklets. 2017-06-07 13:49:30 -05:00
bors-servo
f4a720483d Auto merge of #17202 - BorisChiou:stylo/animation/mismatched_transform, r=Manishearth,birtles
stylo: Bug 1335998 - Handle interpolation and accumulation of mismatched transform lists

These are the interdependent patches of Bug 1335998. We want to do interpolation and accumulation for mismatched transform lists, so introduce ComputedOperation::InterpolateMatrix and ComputedOperation::Accumulation. Both arms store the from_list and to_list, and resolve them until we have the layout information. For the Servo part, we haven't implemented how to read the transform lists in layout/fragment.rs, but I think it would be easy. (related issue #13267)

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [Bug 1335998](https://bugzilla.mozilla.org/show_bug.cgi?id=1335998)
- [X] There are tests for these changes

<!-- 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/17202)
<!-- Reviewable:end -->
2017-06-06 23:54:41 -07:00
Xidorn Quan
3e47e6eab2 Make text-shadow reuse Shadow directly. 2017-06-07 13:32:17 +10:00
Boris Chiou
313f7d86db Define ComputedOperation::AccmulateMatrix.
If we set the composite operation to accumulate, we may need to accumulate two
mismatched transform lists, and then to interpolate them. In order to
accumulate two mismatched transform lists, we also need the reference
box information, so use the same idea as that for interpolation. i.e.
use AccmulateMatrix to store it temporarily, and convert it into matrix
later.
2017-06-07 11:31:01 +08:00
Boris Chiou
a6099d0fc0 Define ComputedOperation::InterpolateMatrix.
We use this arm to store the interpolated result of two mismatched
transform lists, and we resolve it until we know the reference box size
(on Gecko side). The conversion from ComputedOperation::InterpolateMatrix
to eCSSKeyword_interpolatematrix will be implemented later in this patch series.
2017-06-07 11:30:39 +08:00
Matt Brubeck
7fd1626901 Reduce allocations during parallel layout 2017-06-06 12:34:36 -07:00
Matt Brubeck
ea154d8278 Reduce parallel layout chunk size to 16 2017-06-06 11:50:57 -07:00
Bastien Orivel
0a254b0306 Bump euclid to 0.13 and heapsize to 0.4 2017-06-05 19:28:39 +02:00
Manish Goregaokar
41f1c3463e Bump cssparser to 0.13.7 2017-06-02 17:43:56 -07:00
Anthony Ramine
7da94d0880 Use BorderSideWidth for outline-width 2017-06-02 10:53:27 +02:00
Anthony Ramine
2c7fbb4b4c Use generics for text spacing properties 2017-06-02 10:21:22 +02:00
Anthony Ramine
5c6987a50d Use generics for the line-height property 2017-06-02 10:21:21 +02:00
Cameron McCormack
f62a236d8c Update rayon to 0.7.1.
To take advantage of nikomatsakis/rayon#348.
2017-05-31 17:55:26 +10:00
bors-servo
9d32b9cc35 Auto merge of #16317 - eloycoto:issue6799, r=emilio
Fix #6799: set stacking_context_position correctly on fragment_border_iterator

Hey,

First of all, this is my first PR to Servo project and I'm learning Rust, so sorry if you see something that it's not correct. I did that as best as I know.

This PR fix the issue #6799; I tried all the corner cases that I can think about it and always get the right result and the same as other browsers.

Related to the build:

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

In the other hand, I added the test in the cssom folder, is where getBoundingClientRect  is defined, so I think that is the best place.

I'm sure that the line 122 can be better, but I didn't find a way to transform a Point2D from f32 to px in a easy way.

I'm here to listen to your recommendations and fix any issue.
Thanks!

<!-- 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/16317)
<!-- Reviewable:end -->
2017-05-30 11:28:26 -05:00
bors-servo
38a6a3bff6 Auto merge of #17063 - emilio:pres-hints-sharing, r=bholley
style: Allow sharing styles across elements with presentational hints.

<!-- 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/17063)
<!-- Reviewable:end -->
2017-05-30 07:28:06 -05:00
Eloy Coto
33a46597ed Fix #6799: set stacking_context_position correctly on
fragment_border_iterator
2017-05-30 09:38:37 +02:00
Emilio Cobos Álvarez
0adc02a317
style: Avoid some cfg checks in context.rs 2017-05-29 23:24:06 +02:00
Anthony Ramine
862fc4f88d Rename BorderRadiusSize to BorderCornerSize 2017-05-29 00:58:53 +02:00
Anthony Ramine
af3ede418b Refactor BorderRadius and move it to the border modules
BorderRadius now parses itself reusing Rect<T>.
2017-05-28 14:36:37 +02:00
Anthony Ramine
4144dc74db Make Rect<T> a struct tuple
It makes no sense to have named fields in some cases, notably to reuse
Rect<T> in BorderRadius<T>.
2017-05-28 14:36:36 +02:00
bors-servo
7275f65981 Auto merge of #17036 - servo:derive-all-the-things, r=emilio
Use values::generics::rect::Rect some more

<!-- 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/17036)
<!-- Reviewable:end -->
2017-05-27 05:41:12 -05:00
Simon Sapin
4e4b5ab5c8 Decode UTF-8 code points across network packets 2017-05-27 09:01:45 +02:00
Eloy Coto
2151a1f459 FMT 2017-05-25 21:04:48 +02:00
Anthony Ramine
ca8fae91da Use generics for background-size property 2017-05-25 17:27:11 +02:00
Emilio Cobos Álvarez
deaa935f5b
layout: Stop doing unsafe transmutes between refcell references.
This commit splits the style and layout data in two separate refcells.

These transmutes have been a source of trouble (for example on Android), and
they feel like a hack anyway.

Fixes #16982
2017-05-25 10:31:40 +02:00
bors-servo
b4cebe1920 Auto merge of #17002 - servo:derive-all-the-things, r=emilio
Introduce style::values::generics::rect ▭

<!-- 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/17002)
<!-- Reviewable:end -->
2017-05-24 02:18:01 -05:00
bors-servo
f3a694a7b4 Auto merge of #16999 - bzbarsky:fix-text-overflow-handling, r=Manishearth
Fix stylo's text-overflow handling to match gecko.

A single value sets the text-overflow on the _end_ of the text, not both start and end.

<!-- 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
- [ ] 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/16999)
<!-- Reviewable:end -->
2017-05-23 20:39:24 -05:00
Boris Zbarsky
9f482c1430 Fix stylo's text-overflow handling to match gecko.
A single value sets the text-overflow on the _end_ of the text, not both start and end.
2017-05-23 14:35:45 -04:00
Anthony Ramine
078d4ed40c Use generics for border-image-slice property 2017-05-23 14:36:54 +02:00
bors-servo
edd6c2cecb Auto merge of #16779 - behnam:bidi-0.3, r=mbrubeck
[gfx] [layout] [style] Upgrade unicode-bidi to 0.3

Depends on https://github.com/servo/unicode-bidi/pull/27 , which
upgrades `unicode-bidi` crate to `0.3.0`.

Summary of changes:

* Use `unicode_bidi::Level` (instead of `u8`) in all relevant places and
replace magic computations with (inline) method calls to Level API.

* Doing so required adding `unicode-bidi` crate dependency to two more
components here: `style` and `gfx`. IMHO, totally makes sense, as
replaces local integer manipulations/checks with well-tested ones
already available in a common dependency.

---
<!-- 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). [N/A]

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because `unicode-bidi` has its own tests and there's no logic change in this diff.

<!-- 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/16779)
<!-- Reviewable:end -->
2017-05-22 23:06:07 -05:00
Behnam Esfahbod
14c524df4f [gfx] [layout] [style] Upgrade unicode-bidi to 0.3 2017-05-22 20:06:19 -05:00
Anthony Ramine
499e81410f Parse -moz-alt-content as a whole content value (fixes #15726) 2017-05-22 13:59:36 +02:00
Bobby Holley
a182ae46f6 Rewrite parallel.rs to be not slow. 2017-05-21 07:45:39 +02:00
Cameron McCormack
8b7a414b1c
style: Use RestyleDamage to determine whether we must continue cascading style changes to children. 2017-05-20 16:25:39 +02:00
Manish Goregaokar
2230332f46 Update app_units to 0.4.1 2017-05-19 20:33:02 -07:00
bors-servo
62690887c1 Auto merge of #16913 - jdm:canvas2d, r=jdm
Make canvas origin clean checks use origin of image response

Adapted from #15887.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #15409
- [X] There are tests for these changes

<!-- 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/16913)
<!-- Reviewable:end -->
2017-05-19 10:45:44 -05:00
SendilKumar N
5acee23f5d Use the origin of the actual image response when determining if a canvas is origin clean. 2017-05-19 09:38:50 -04:00
Anthony Ramine
307dd74ecf Introduce CalcLengthOrPercentage::unclamped_length
This is necessary for some operations, notably converting this to something
suitable for gecko.
2017-05-18 19:27:31 +02:00
Anthony Ramine
d0b9bd9c64 Refactor how calc() clamping is done on computed values (fixes #15296) 2017-05-18 10:14:59 +02:00