Commit graph

592 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
c69f769285
Revert "Rewrite CounterStyleOrNone::from_gecko_value to use fewer binding functions"
This reverts commit 65c2047df2.
2017-08-30 14:21:13 +02:00
Xidorn Quan
65c2047df2 Rewrite CounterStyleOrNone::from_gecko_value to use fewer binding functions 2017-08-30 13:52:19 +10:00
bors-servo
2136dd2bb7 Auto merge of #18244 - kahsieh:master, r=Manishearth
stylo: Update CSS fallback font when lang changes

r=manishearth in BugZilla.

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

<!-- 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/18244)
<!-- Reviewable:end -->
2017-08-25 17:30:22 -05:00
Kevin Hsieh
cfa98a3ab6 Update CSS fallback font when lang changes 2017-08-25 14:12:34 -07:00
Nazım Can Altınova
81be90cce2 Implement font feature values lookup for stylo 2017-08-25 12:03:38 -07:00
Gecko Backout
12b02ce9d5 Backed out changeset 01348a3860f7 for build bustage
CLOSED TREE

Backs out https://github.com/servo/servo/pull/18222
2017-08-25 03:45:31 +00:00
Nazım Can Altınova
6d7a1903b8 Implement font feature values lookup for stylo 2017-08-24 12:41:36 -07:00
Mantaroh Yoshinaga
1c574cf93b Add SVGLengthOrPercentageOrNumber for stroke-*.
We need to use enum instead of Either since we can't interpolate stroke-* between
unitless length and unit length(e.g. '5' -> '10px').

This coomit make following:

 * Introduce SVGLengthOrPercentageOrNumber on computed and specified values.
 * Make SVGLengthOrPercentageOrNumber animatable.
 * Make stroke-dasharray not-accumulate.
2017-08-18 10:28:11 +09:00
Simon Sapin
35282042bc geckolib: Fix some warnings (treated as error) new in Rust Nigthly 2017-08-17 15:59:33 +02:00
Nazım Can Altınova
6893446b71 Add a pref checking mechanism for alias properties 2017-08-16 13:23:14 -07:00
bors-servo
41fb10c589 Auto merge of #18085 - dadaa:make-content-animatable, r=hiro
Make content animatable

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

<!-- Either: -->
- [X] There are tests for these changes. The test codes are patch part 3 and 4 in https://bugzilla.mozilla.org/show_bug.cgi?id=1382136

<!-- 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/18085)
<!-- Reviewable:end -->
2017-08-15 05:50:15 -05:00
bors-servo
87c872a7f7 Auto merge of #18081 - hiikezoe:interpolation-with-auto, r=birtles,boris,mantaroh
Fix interpolation between auto and other values

<!-- Please describe your changes on the following line: -->
https://bugzilla.mozilla.org/show_bug.cgi?id=1387939

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- 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/18081)
<!-- Reviewable:end -->
2017-08-15 03:28:21 -05:00
Daisuke Akatsuka
c05baa2327 Implement clone_content method 2017-08-15 15:25:05 +09:00
Hiroyuki Ikezoe
19d498f01e Make assertion for colum-count more accurate.
column-count should be greater than or equal to 1. Also it should be less than
or equal to nsStyleColumn_kMaxColumnCount since we limit it in
set_column_count().
2017-08-15 13:03:33 +09:00
Hiroyuki Ikezoe
6d49d8151c Don't convert zero component value to 'auto' in clone__moz_image_region.
Currently Gecko treats 'auto' component value as zero for animation.
2017-08-15 12:34:45 +09:00
bors-servo
f93c6dfbd5 Auto merge of #18066 - dadaa:make-moz-appearance-animatable, r=hiro
Make -moz-appearance animatable

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

<!-- Either: -->
- [X] There are tests for these changes. The test code is patch part 2 in https://bugzilla.mozilla.org/show_bug.cgi?id=1382138

<!-- 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/18066)
<!-- Reviewable:end -->
2017-08-14 02:24:47 -05:00
Daisuke Akatsuka
cdea3d20c4 Make -moz-appearance animatable 2017-08-14 10:41:52 +09:00
Nicholas Nethercote
1a40101d2f Overhaul ComputedValues measurement, and add style structs measurement. 2017-08-14 10:49:48 +10:00
Manish Goregaokar
69070c7592 stylo: Don't call fixup_generic_font for system or CSS wide specified fonts 2017-08-11 14:51:45 -07:00
bors-servo
58e8a3126a Auto merge of #18042 - upsuper:grid-template, r=canaltinova
Make nsStylePosition::mGridTemplate{Columns,Rows} a UniquePtr.

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

<!-- 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/18042)
<!-- Reviewable:end -->
2017-08-11 06:32:44 -05:00
Xidorn Quan
888012dcf6 Make nsStylePosition::mGridTemplate{Columns,Rows} a UniquePtr. 2017-08-11 21:17:38 +10:00
Anthony Ramine
c4e33d9dca Animate basic shapes 2017-08-11 10:25:03 +02:00
Manish Goregaokar
4d4cde293f Correctly scale -moz-min-font-size-ratio 2017-08-09 22:00:05 -07:00
bors-servo
955b625060 Auto merge of #18003 - DarkDrek:move_percentage, r=canaltinova
Move percentage to mod.rs

<!-- Please describe your changes on the following line: -->
The tests in the issue worked for me locally.

---
<!-- 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
- [X] These changes fix #18001 (github issue number if applicable).

<!-- Either: -->
- [X] These changes do not require tests because they are just refactoring

<!-- 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/18003)
<!-- Reviewable:end -->
2017-08-08 13:01:00 -05:00
DarkDrek
a5b585a5f1 Move Percentage from length.rs to mod.rs 2017-08-08 16:44:31 +02:00
bors-servo
10c3e2f3ac Auto merge of #17985 - dadaa:make-list-style-type-animatable, r=hiro
Make list-style-type animatable

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

<!-- Either: -->
- [X] There are tests for these changes. The test is patch 3 in https://bugzilla.mozilla.org/show_bug.cgi?id=1382137

<!-- 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/17985)
<!-- Reviewable:end -->
2017-08-07 19:06:43 -05:00
bors-servo
016ea11cba Auto merge of #17783 - BorisChiou:stylo/animation/restrictions, r=nox
stylo: Bug 1374233 - Clamp interpolated values for properties which need to be restricted

Some properties only accept non-negative values, or values greater than or equal to one. It is possible to produce an negative interpolated values while using negative timing functions, so we have to apply a restriction to these values to avoid getting invalid values.

For example, line-height must be non-negative, but the output progress of some timing functions (e,g. cubic-bezier(0.25, -2, 0.75, 1)) may be a negative value, so the interpolated result of line-height is also negative.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix Bug 1374233.
- [X] These changes do not require tests because we have tests in Gecko side already.

<!-- 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/17783)
<!-- Reviewable:end -->
2017-08-07 11:05:17 -05:00
Daisuke Akatsuka
73dfc28413 make list-style-type animatable 2017-08-07 13:14:56 +09:00
Cameron McCormack
8899328634 style: Preserve font-family identifier sequence when serializing. 2017-08-05 17:47:24 +08:00
Cameron McCormack
e163352714 Revert "style: Preserve font-family identifier sequence when serializing."
This reverts commit 4f525f6fa0.
2017-08-05 15:03:26 +08:00
bors-servo
ac37f81c1f Auto merge of #17972 - heycam:ignore-existing, r=bholley
style: Allow styles to be computed ignoring existing element data.

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

<!-- 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/17972)
<!-- Reviewable:end -->
2017-08-04 21:33:59 -05:00
Boris Chiou
8651acd94c Bug 1374233 - Part 13: Use NonNegative{*} types for components of Shadow and Filter.
MozReview-Commit-ID: Im4KGy1n9IJ
2017-08-04 14:23:30 +08:00
Boris Chiou
6dd8b159d7 Bug 1374233 - Part 12: Implement ToAnimatedValue for LineHeight.
Besides, we replace its type with
GenericLineHeight<NonNegativeNumber, NonNegativeAu>.

MozReview-Commit-ID: GGOGXyUFJsJ
2017-08-04 14:23:28 +08:00
Boris Chiou
bd0a098ef1 Bug 1374233 - Part 9: Add NonNegativeLengthOrPercentageOrNumber for stroke-{width|dasharry}.
Also add SVGWidth which use NonNegativeSVGLengthOrPercentage
as the LengthType for stroke-width.

MozReview-Commit-ID: 8gD0fVe2eAe
2017-08-04 14:23:24 +08:00
Boris Chiou
e72a0f126e Bug 1374233 - Part 7: Add NonNegativeLengthOrPercentage.
For padding-{*} and grid-{*}-gap.

MozReview-Commit-ID: 81G0b1k6JnD
2017-08-04 14:23:21 +08:00
Boris Chiou
9d69cb2866 Bug 1374233 - Part 6: Add PositiveInteger and PositiveIntegerOrAuto for column-count.
column-count should be a positive integer or auto.

MozReview-Commit-ID: 9LFvrYo8De5
2017-08-04 14:23:17 +08:00
Boris Chiou
190cd5b952 Bug 1374233 - Part 5: Use NonNegativeLength and NonNegativeAu for border-spacing.
We already have NonNegativeLength and NonNegativeAu, so we can re-use it
to define the specified value and the computed value of border-spacing.
And then implement ToAnimatedValue for it.

MozReview-Commit-ID: CLckpKMYVXU
2017-08-04 14:22:36 +08:00
Boris Chiou
2ef38ce67a Bug 1374233 - Part 4: Add NonNegativeLengthOr{Auto|Normal|Number}.
Add NonNegativeLength, which could be computed to NonNegativeAu. So we
can declare Either<NonNegativeLength, X>, X=Auto, Normal, or Number.

NonNegativeLengthOrAuto is for column-width.
NonNegativeLengthOrNormal is for column-gap.
NonNegativeLengthOrNumber is for -moz-tab-size.

MozReview-Commit-ID: AfU8XpA1um0
2017-08-04 14:22:32 +08:00
Boris Chiou
234d2c1b32 Bug 1374233 - Part 3: Use NonNegativeAu as computed values for font-size related properties.
For font-size and font-size-adjust.

MozReview-Commit-ID: 5rrfVSzB7WF
2017-08-04 14:21:59 +08:00
Boris Chiou
191c2a282b Bug 1374233 - Part 2: Add NonNegativeAu.
Add values::computed::NonNegativeAu, so BorderSideWith could be computed
to this non-negative Au, for the following properties:
1. outline-width
2. border-{*}-width
3. column-rule-width
4. -webkit-text-stroke-width

MozReview-Commit-ID: ASHaB2F7VtM
2017-08-04 14:21:57 +08:00
Boris Chiou
4cc97746f2 Bug 1374233 - Part 1: Add NonNegativeNumber and GreaterThanOrEqualToOneNumber.
NonNegativeNumber: for -moz-box-flex, flex-grow, and flex-shrink.
GreaterThanOrEqualToOneNumber: for stroke-miterlimit.

MozReview-Commit-ID: Kgbt99BPdVA
2017-08-04 14:21:21 +08:00
Daisuke Akatsuka
c5de3e56a2 make image-orientation animatable 2017-08-03 22:34:14 +09:00
Daisuke Akatsuka
25a46c40b3 make paint-order animatable 2017-08-03 22:33:28 +09:00
Nicholas Nethercote
526e9691f8 stylo: Measure Elements and ComputedValues.
The patch provides FFI access to Gecko's SeenPtrs type from Rust, in
order to record what has already been measured when measuring Arcs. (The
SeenPtrs must be initialized on the Gecko side because the same table is
reused for measuring all Elements within a window, because Elements can
share ComputedValues.) I have confirmed with DMD that this is working
correctly.

The patch also introduces MallocSizeOfRepeats, which is like
MallocSizeOf but takes a SizeOfState, which holds a SeenPtrs table.
2017-08-03 09:15:38 +10:00
Manish Goregaokar
0e3f7d782b stylo: Disable text-zoom for <svg:text> 2017-08-02 10:25:55 -07:00
Manish Goregaokar
613012d9fb stylo: Handle text-zoom for scriptminsize 2017-08-02 10:25:27 -07:00
Manish Goregaokar
16d46eaf7a stylo: Handle text-zoom for font-size 2017-08-02 10:25:14 -07:00
Xidorn Quan
ef4352d2a5 Add context-{fill,stroke}-opacity support to {fill,stroke}-opacity. 2017-08-02 10:35:18 +10:00
Xidorn Quan
7827ca6bb5 Make stroke-dasharray accept context-value. 2017-08-02 10:35:17 +10:00
Xidorn Quan
aa80859a71 Add SVGLength which accepts context-value, and use it for stroke-{width,dashoffset}. 2017-08-02 10:03:15 +10:00