Commit graph

592 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
c591df7012
stylo: Fix causes of non-determinism in gecko_properties.rs.
We should sort out all the different ways we have to get sides and all those
nasty loops, eventually...

Bug: 1380327
Reviewed-By: Manishearth
MozReview-Commit-ID: 4lAPEGeZaik
2017-07-12 21:59:11 +02:00
Gecko Backout
02d9305782 Backed out changeset 3977404931e5 for failing mochitest layout/style/test/test_value_computation.html. r=backout
Backs out https://github.com/servo/servo/pull/17654
2017-07-11 22:14:04 +00:00
Jonathan Chan
e554146e2a Make Servo's rounding of image-orientation values agree with Gecko's,
and pass orientations directly as an enum instead of as angles.

Depends on a Gecko change to be subsequently landed in m-c.
2017-07-11 11:19:39 -07:00
J. Ryan Stinnett
3463a9c210 Pass through visited style for after change
When a transition update is needed during restyling, `get_after_change_style` is
called to re-cascade without transition rules, and this style is then used for
primary styling instead of the style just computed.

`get_after_change_style` used to ignore visited styles, so this meant that if a
transition update was needed, visited styles were effectively dropped.

To fix the crash here, we pass through the existing visited styles when
re-cascading as part of `get_after_change_style`.

MozReview-Commit-ID: 4HBQAdeJ38B
2017-07-10 13:28:12 -05:00
bors-servo
f11a922760 Auto merge of #17430 - upsuper:font-weight-int, r=nox
Store font-weight as integer directly

It doesn't make much sense to store `font-weight` as separate enums, especially given that we would need to support (somehow) arbitrary font weight value when we implement CSS Fonts Level 4.

This PR refactors the `font-weight` a bit to make it store as `u16` directly.

<!-- 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/17430)
<!-- Reviewable:end -->
2017-07-06 16:18:36 -07:00
Xidorn Quan
8b842f5417 Use integer for specified and computed font-weight 2017-07-06 15:31:24 +10:00
bors-servo
7323c7745c Auto merge of #17617 - mantaroh:svg-paint-server, r=hiro,manishearth
Handling of invalid values in svg paint server

<!-- Please describe your changes on the following line: -->
This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1374161

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

<!-- Either: -->
There are tests for these changes, a test case will be landed in reftests in https://bugzilla.mozilla.org/show_bug.cgi?id=1374161.

<!-- 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/17288)
<!-- Reviewable:end -->
2017-07-05 21:49:27 -07:00
Mantaroh Yoshinaga
338eeed474 Clone the url data of paint server. 2017-07-06 09:01:41 +09:00
Nazım Can Altınova
6fb403c396 stylo: Add auto-filled line names to mRepeatAutoLineNameListBefore. 2017-07-05 16:32:18 -07:00
Daisuke Akatsuka
d8dcc52c9a implements nsStyleImageRequest type properties animatable 2017-07-05 13:11:58 +09:00
Daisuke Akatsuka
d885747a18 implements nsStyleImage type properties animatable 2017-07-05 13:10:58 +09:00
Daisuke Akatsuka
4924a4832f implements URLValue type properties animatable 2017-07-05 13:08:12 +09:00
Daisuke Akatsuka
b3def4a84e implements u8 and array type properties animatable 2017-07-05 13:07:22 +09:00
Daisuke Akatsuka
961bdee6a3 implements nsFont type properties animatable 2017-07-05 13:07:20 +09:00
Daisuke Akatsuka
699ec02e8b implements nsStyleBorder type properties animatable 2017-07-05 13:07:08 +09:00
Daisuke Akatsuka
0555977c66 implements nsStyleQuoteValues type properties animatable 2017-07-05 13:00:02 +09:00
Daisuke Akatsuka
7d1374e019 implements nsStyleTextOverflow type properties animatable 2017-07-05 12:59:12 +09:00
Daisuke Akatsuka
6316b7aeb8 implements nsStyleCounterData type properties animatable 2017-07-05 12:58:10 +09:00
Daisuke Akatsuka
a155a6341d implements nsStyleSides type properties animatable 2017-07-05 12:57:30 +09:00
Daisuke Akatsuka
34980689a7 implements nsStyleGridLine type properties animatable 2017-07-05 12:55:51 +09:00
Daisuke Akatsuka
983361eb0f implements nsStyleCoord type properties animatable 2017-07-05 12:54:45 +09:00
Manish Goregaokar
6c94ace6e5 Revert "style: Cleanup duplicated code in the definition of ComputedValues."
This reverts commit 1c2fcb16ca.
2017-07-03 21:48:12 -07:00
bors-servo
7a71035793 Auto merge of #17268 - servo:grid, r=wafflespeanut,canaltinova
Add support for subgrids and fix some other grid properties

This covers the `subgrid <line-name-lists>?` for `grid-template` (for gecko, and hence, stylo).

<!-- 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/17268)
<!-- Reviewable:end -->
2017-07-03 17:10:25 -07:00
Ravi Shankar
9d9d99ec25 Switch to GridTemplateComponent for subgrid line names 2017-07-03 17:08:00 -07:00
Nazım Can Altınova
5d0f7f10e0 stylo: Fix font-variant-alternates property 2017-06-29 13:33:38 -07:00
bors-servo
9d1b26de1f Auto merge of #17549 - KuoE0:make-moz-context-properties-support-fill-opacity-and-stroke-opacity, r=heycam
Make '-moz-context-properties' support 'fill-opacity' and 'stroke-opacity'.

Enable 'fill-opacity' and 'stroke-opacity' for '-moz-context-properties' to make the context-{fill|stroke}-opacity work in SVG-as-an-image.

---
<!-- 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 [Bug 1373159](https://bugzilla.mozilla.org/show_bug.cgi?id=1373159)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because the test cases will be added in gecko.

<!-- 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/17549)
<!-- Reviewable:end -->
2017-06-28 13:01:32 -07:00
KuoE0
2063f2217e Bug 1373159 - [servo] Make '-moz-context-properties' support 'fill-opacity' and 'stroke-opacity'.
MozReview-Commit-ID: Buzlxfwpr6h
2017-06-28 10:45:15 -07:00
Anthony Ramine
201d7e79e7 Make text-shadow and box-shadow use SimpleShadow 2017-06-28 16:28:25 +02:00
Anthony Ramine
395f6be0a6 Use the Separator trait for the filter property 2017-06-27 23:40:16 +02:00
Emilio Cobos Álvarez
1c2fcb16ca
style: Cleanup duplicated code in the definition of ComputedValues. 2017-06-26 15:52:43 -07:00
Emilio Cobos Álvarez
5c7632f4c4
style: Add some flags to the computed values.
This will allow us to fix propagation of text-decoration, and also to implement
inlinization of ruby kids.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-06-26 15:52:42 -07:00
Anthony Ramine
ae1c890c9e Rename DropShadow to SimpleShadow 2017-06-23 16:25:50 +02:00
J. Ryan Stinnett
2b5c56e6a8 Move match and cascade temporaries to CurrentElementInfo
Before this change, the `ComputedStyle` struct that is part of permanent style
data per element holds 2 `StrongRuleNode`s (unvisited and visited) and 2
`Arc<ComputedValues>` (unvisited and visited).

Both rule nodes and the visited values don't actually need to be here.  This
patch moves these 3 to new temporary storage in `CascadeInputs` on
`CurrentElementInfo` during the match and cascade process.  Rule nodes are
pushed down inside the `ComputedValues` for later access after the cascade.
(Visited values were already available there.)

The permanent style data per element now has just the `Arc<ComputedValues>` for
itself and eager pseudo-elements (plus the `RestyleHint`).

MozReview-Commit-ID: 3wq52ERMpdi
2017-06-22 15:47:32 -05:00
Emilio Cobos Álvarez
6fefe522a3
style: Assert we never style a root element from another document.
Right now when calling getComputedStyle with an element from another document,
we return the style using the pres context of that document, not of the document
of the window getComputedStyle was called on, so this holds.

But it will stop holding if we ever change this, so assert it doesn't happen.

Bug: 1374062
Reviewed-By: Manishearth
MozReview-Commit-ID: 3g8yQWWdsen
2017-06-21 19:55:02 +02:00
Anthony Ramine
6f4061d4ad Use generics for the filter property
This introduces an additional shadow type for drop-shadow().
2017-06-20 13:48:53 +02:00
Ravi Shankar
c145dd7b0c Cleanup some old code 2017-06-18 21:18:43 -07:00
Mantaroh Yoshinaga
87e580a33d Make filter property animatable. 2017-06-19 09:47:26 +09:00
Anthony Ramine
608e7f71a2 Make computed types hold Percentage instead of bare CSSFloat 2017-06-15 16:59:03 +02:00
Anthony Ramine
9f03553ed5 Use CustomIdent in GridLine 2017-06-15 14:15:19 +02:00
Anthony Ramine
51a4481388 Use CustomIdent for transition-property 2017-06-15 13:03:23 +02:00
Anthony Ramine
cdcc8157c6 Use CustomIdent in will-change 2017-06-15 13:00:59 +02:00
Xidorn Quan
08c12062c7 Resolve counter style during parallel traversal when possible. 2017-06-14 20:05:38 +10:00
bors-servo
ff17af064b Auto merge of #17262 - Manishearth:bindings, r=Manishearth
Update bindings for StyleImageLayerRepeat

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

<!-- 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/17262)
<!-- Reviewable:end -->
2017-06-09 15:56:10 -07:00
Manish Goregaokar
fd0ac4f31e Update bindings for StyleImageLayerRepeat 2017-06-09 13:26:16 -07:00
bors-servo
88b47b0154 Auto merge of #17253 - dadaa:bug1368610, r=hiikezoe,nox,emilio
Bug1368610 - stylo: implement primitive (bit, uXX) type of discrete animatable properties

<!-- Please describe your changes on the following line: -->
This PR is to fix https://bugzilla.mozilla.org/show_bug.cgi?id=1368610

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

<!-- Either: -->
- [X] There are tests for these changes. The tests will land in dom/animation/test of m-c. Test code is patch 6 of https://bugzilla.mozilla.org/show_bug.cgi?id=1368610

<!-- 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/17253)
<!-- Reviewable:end -->
2017-06-09 10:01:35 -07:00
Daisuke Akatsuka
a3d2b67cd5 Implements properties that need to change only the animation type animatable 2017-06-09 23:47:07 +09:00
Daisuke Akatsuka
367c0a4b43 Implements numeric field type properties animatable 2017-06-09 23:46:51 +09:00
Daisuke Akatsuka
9751fb9358 Implements other bit type properties animatable 2017-06-09 23:46:37 +09:00
Daisuke Akatsuka
f358ec069c Implements gecko keyword bit type properties animatable 2017-06-09 23:46:28 +09:00
Daisuke Akatsuka
21b7b256c2 Implements bitflags properties animatable 2017-06-09 23:46:11 +09:00