Commit graph

783 commits

Author SHA1 Message Date
bors-servo
9d5dde2604 Auto merge of #16384 - canaltinova:shape-outside, r=Manishearth
stylo: Implement shape-outside property

shape-outside property implemented.
r=Manishearth in bugzilla

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

<!-- 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/16384)
<!-- Reviewable:end -->
2017-04-12 19:04:28 -05:00
bors-servo
294f44eca0 Auto merge of #16382 - nox:calc-clamping, r=emilio
Don't reject out of bound calc() values at parsing-time

<!-- 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/16382)
<!-- Reviewable:end -->
2017-04-12 13:31:21 -05:00
Manish Goregaokar
2e22a006db stylo: Support -moz-script-size-multiplier, -moz-script-level, -moz-math-display 2017-04-12 22:15:49 +08:00
Nazım Can Altınova
d0619a7c5c
stylo: Implement shape-outside property 2017-04-12 16:06:03 +03:00
Anthony Ramine
dfbd89860a Don't reject out of bound calc() values at parsing-time
https://bugzilla.mozilla.org/show_bug.cgi?id=1355014
2017-04-12 14:07:38 +02:00
Manish Goregaokar
8b9163900d stylo: Cascade relative font-sizes applied to keyword sizes 2017-04-12 16:59:14 +08:00
bors-servo
7ba3f1e4f3 Auto merge of #16358 - bholley:style_sharing_fixes, r=emilio
Fix up the style sharing cache

Reviewed in:
https://bugzilla.mozilla.org/show_bug.cgi?id=1354895
https://bugzilla.mozilla.org/show_bug.cgi?id=1332525

<!-- 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/16358)
<!-- Reviewable:end -->
2017-04-11 22:52:23 -05:00
bors-servo
7262270990 Auto merge of #16345 - CJKu:cku-master, r=heycam
stylo: Correct computed value of mask-image.

<!-- Please describe your changes on the following line: -->
The patch is part of fix in Bug 1341667(stylo: Figure out why all the W3C masking reftests fail)

---
<!-- 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 #__ (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/16345)
<!-- Reviewable:end -->
2017-04-11 22:07:36 -05:00
Bobby Holley
fbdfbb1dfa Do a better job of detecting where there are transitions.
The current code thinks that every element has transitions.
2017-04-12 10:35:47 +08:00
bors-servo
52c68736e1 Auto merge of #16349 - chenpighead:stylo-initial-letter-support, r=heycam
Stylo - add glue code for initial-letter property

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

Add glue code for initial-letter property.

---
<!-- 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 #__ (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/16349)
<!-- Reviewable:end -->
2017-04-11 20:22:59 -05:00
Jeremy Chen
76b48c3c41 Stylo - add glue code for initial-letter property 2017-04-11 21:09:09 +08:00
Jeremy Chen
5332d4b265 Stylo - support image-orientation property
First, we need to make Servo's image-orientation parser to be agreed with Gecko's.
Numbers without any AngleUnit, including unitless 0 angle, should be invalid
for image-orientation. However, rotate() and skew() for transform properties
accept unitless 0 angle. In order to make all these properties work properly,
I fixed Angle::parse() to match Gecko. For the existing users of Angle::parse(),
I create Angle::parse_with_unitless() and use it as an alternative for them.
Once https://github.com/w3c/csswg-drafts/issues/1162 is resolved, we shall be
able to use an unified version of Angle::parse() then.

The parser of image-orientation is also fixed to report parsing errors on
empty string.

Then, with the newly added binding functions support in Gecko side, we shall
reuse the same methods from Gecko to pass the computed value from Servo to Gecko.

Gecko bug: Bug 1341758
2017-04-11 19:23:43 +08:00
cku
10c8dbdefd stylo: Correct computed value of mask-image. 2017-04-11 16:44:44 +08:00
Hiroyuki Ikezoe
933a5d2f9c Use from_gecko_style_coord() to convert CoordDataValue to Option<T> for letter-spacing. 2017-04-07 11:21:07 +09:00
Hiroyuki Ikezoe
f1642eb7a6 Make word-spacing animatable. 2017-04-07 11:21:07 +09:00
Hiroyuki Ikezoe
53b4cc3593 Make align-items animatable as discrete type. 2017-04-07 10:38:34 +09:00
Bobby Holley
42f5aea76a Remove shareable boolean from ComputedValues and simplify code.
This code is all vestigial at this point, presumably after a refactoring.

MozReview-Commit-ID: CV0lKMStq13
2017-04-06 11:28:18 -07:00
Hiroyuki Ikezoe
b801e07ec5 Make letter-spacing animatable.
From the spec: 'normal' value computes to zero.
2017-04-06 08:38:04 +09:00
Manish Goregaokar
0392e58a2f
stylo: Add support for text-align match-parent and the <th> -moz-center-or-inherit behavior
MozReview-Commit-ID: GEDM7JfJB8A
2017-04-04 21:16:57 -07:00
Nazım Can Altınova
9991c496b3
Serialize unquoted font-family without quote 2017-03-30 23:40:23 +03:00
Emilio Cobos Álvarez
f61afa15df
Bug 1350140: Fix computation of border and outline-width when the border or outline style change. r=heycam
MozReview-Commit-ID: FjMS47YNNX8
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-03-29 11:53:05 +02:00
bors-servo
af243d5dec Auto merge of #16155 - chenpighead:gecko-glue-for-font-language-override, r=emilio
stylo: Implement gecko glue for font-language-override.

To be aligned with the implementation from Gecko side, we parse
font-language-override as Normal keyword or String. Then, we compute
and store it as a u32. So, as to the stylo glue, we can just pass the
u32 to Gecko.

The extra crate, byteorder, is used to simplify the computing and
serialization.

Since we now implement font-language-override for Gecko, we can remove
the additional branches for font-language-override in font shorthand.

ref: Gecko [Bug 1347821](https://bugzilla.mozilla.org/show_bug.cgi?id=1347821)

<!-- 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/16155)
<!-- Reviewable:end -->
2017-03-28 15:05:33 -05:00
Jeremy Chen
a9e4b9caa6 stylo: Implement gecko glue for font-language-override.
To be aligned with the implementation from Gecko side, we parse
font-language-override as Normal keyword or String. Then, we compute
and store it as a u32. So, as to the stylo glue, we can just pass the
u32 to Gecko.

The extra crate, byteorder, is used to simplify the computing and
serialization.

Since we now implement font-language-override for Gecko, we can remove
the additional branches for font-language-override in font shorthand.

ref: Gecko Bug 1347821
2017-03-28 15:34:08 +08:00
James Bendig
67282f9bee Add full parsing/serialization for mask-repeat and background-repeat 2017-03-27 14:52:56 -05:00
Emilio Cobos Álvarez
9e2977d49e
style: Fix Geckolib build. 2017-03-27 12:42:32 +02:00
Emilio Cobos Álvarez
c7ce2ff483
style: Make numbers keep track of whether they were specified as calc(). 2017-03-27 03:56:30 +02:00
Nazım Can Altınova
645971b387
Rename and move PercentageOrNumber to values 2017-03-25 21:58:32 +03:00
Manish Goregaokar
3139a90386 stylo: Special-case initial-computation of font-size
MozReview-Commit-ID: Ff6kt8RLChI
2017-03-24 11:10:35 -07:00
Manish Goregaokar
fddddc9711 stylo: Calculate font-size keywords based on base size
MozReview-Commit-ID: Ff6kt8RLChI
2017-03-24 10:54:06 -07:00
Bobby Holley
16e04046b5 Use a wrapper class to maintain the mBinding invariant and stop resolving during the cascade. 2017-03-22 18:10:47 -07:00
Lucjan Suski
99aee290db Stylo: Add gecko glue for grid-auto-flow 2017-03-22 11:09:23 +01:00
Nazım Can Altınova
ea1e405500
Implement gecko glue for will-change 2017-03-21 21:10:07 +03:00
Jeremy Chen
615c8cb5e6 stylo: Add support for text-size-adjust property 2017-03-20 11:34:48 +08:00
bors-servo
8f3f8098c3 Auto merge of #16006 - upsuper:box-ordinal-group, r=Manishearth
Implement -moz-box-ordinal-group property

This PR fixes #16000.

<!-- 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/16006)
<!-- Reviewable:end -->
2017-03-17 15:15:01 -07:00
Xidorn Quan
a1acb29aed Add support for -moz-box-ordinal-group 2017-03-17 23:08:07 +11:00
Xidorn Quan
ab0e5c9d99 Switch column-count to use predefined integer type 2017-03-17 23:08:05 +11:00
Xidorn Quan
9233882d49 Switch z-index to use predefined integer type 2017-03-17 23:08:03 +11:00
cku
e8d8b9984f stylo: Update clip-path glue. 2017-03-17 19:55:31 +08:00
bors-servo
b1275591a0 Auto merge of #15970 - StefanoChiodino:master, r=emilio
<!-- Please describe your changes on the following line: -->
I've mostly followed the description of #15842, but on the last line, where `copy` is mentioned, I'm assuming that `clone` was meant instead. It doesn't run successfully `./mach build-geckolib` because

`/Users/stefano/dev/rust/servo/target/geckolib/debug/build/style-bea86181fb38deda/out/gecko_properties.rs:10990:36
      |
10990 |             self.gecko.mCaretColor.into()
      |                                    ^^^^ the trait
std::convert::From<gecko_bindings::structs::root::mozilla::StyleComplexColor> is not implemented for values::Either<cssparser::Color, values::Auto>`

---
<!-- 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 #15842 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/15970)
<!-- Reviewable:end -->
2017-03-16 16:55:51 -07:00
Bobby Holley
8cf331a498 Rearrange PropertyDeclaration to avoid embedding DeclaredValue.
From https://bugzilla.mozilla.org/show_bug.cgi?id=1347719

This effectively combines the discriminants of the two enums and reduces the
size of PropertyDeclaration by one word.

MozReview-Commit-ID: 9rCRiSVZTQT
2017-03-16 14:40:55 -07:00
Stefano Chiodino
f195b247c0 #15842 Add gecko glue for caret-color.
Implement from(StyleComplexColor) for ColorOrAuto. Thanks @emilio. (+4 squashed commits)
Squashed commits:
[baf7cc0] Add clone to caret-color
[9cb82ca] Correctly call methods to copy a color in a SympleComplexColor and getting its auto
[c483f07] Add set and copy functions for caret_color
[0aa20be] Move caret-color and set its product property to gecko
2017-03-16 16:13:34 +00:00
Manish Goregaokar
2ae317f526 stylo: Support counter-increment and counter-reset
MozReview-Commit-ID: DnSd8xAkidM
2017-03-14 09:25:02 -07:00
Manish Goregaokar
07723eba7a stylo: Implement remaining content values
MozReview-Commit-ID: 9fLM5bdR8hr
2017-03-14 09:24:58 -07:00
Manish Goregaokar
77d7490d59 stylo: Use ServoBundledURI everywhere else, fix from_ffi to handle the error case
MozReview-Commit-ID: DHNKLm3y5Gv
2017-03-14 09:16:30 -07:00
Emilio Cobos Álvarez
eaf27ccfa0
style: Kill SharedStyleContext::default_computed_values.
Now that cascade() gets a Device, we can use the default computed values from
there to avoid propagating that state all over the place.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-03-14 00:49:16 +01:00
Hiroyuki Ikezoe
1c607dcc2a Fill shortage values for animation/transition properties. 2017-03-13 12:42:38 +09:00
Hiroyuki Ikezoe
c9b0ea314f Don't set transition properties to mAnimations array. 2017-03-13 12:42:01 +09:00
Nazım Can Altınova
458b7682e6
Stylo: Add support for "font-family: -moz-fixed" 2017-03-12 00:57:20 +03:00
bors-servo
63bed27073 Auto merge of #15900 - hiikezoe:process-css-animations, r=heycam
Process css animations for gecko

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

---
<!-- 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
- [X] These changes do not require tests because it's for stylo

<!-- 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/15900)
<!-- Reviewable:end -->
2017-03-09 20:23:21 -08:00
Hiroyuki Ikezoe
d8f08b80e0 Implement Gecko_StyleAnimationsEquals for checking nsStyleAutoArray<StyleAnimation> equality in servo side.
Later we update CSS animations if this function returns false.
2017-03-10 11:07:18 +09:00