Commit graph

170 commits

Author SHA1 Message Date
Simon Sapin
86562992da Cascade: skip duplicated properties before rather than after a virtual call. 2017-02-26 19:02:53 +01:00
Manish Goregaokar
b85e1f5f0c stylo: Add helpers for converting Gecko keywords to Servo, use to support keyword pres attrs 2017-02-18 20:31:08 -08:00
Manish Goregaokar
ff08de8ad1 stylo: Support stroke-dasharray and stroke-dashoffset
MozReview-Commit-ID: 4QKKzJ1DVYP
2017-02-18 02:43:36 -08:00
Bobby Holley
ae87b8a910 Switch from error! and println! to warn!, and set the default log level to warn on debug builds. 2017-02-14 17:19:01 -08:00
Manish Goregaokar
6b0d3902de Factor out ClipRect type into values; use Either for clip
MozReview-Commit-ID: C3R1erJdiID
2017-02-09 15:09:35 -08:00
Manish Goregaokar
20796ee94e stylo: Implement scroll-snap-coordinate
MozReview-Commit-ID: 6mr4ktfeEGT
2017-02-09 15:09:27 -08:00
Nazım Can Altınova
adb6d20293 Box DeclaredValue::WithVariables 2017-02-09 11:10:10 +01:00
Nazım Can Altınova
78afe2b8d1 Box larger specified values to avoid memmove impact 2017-02-09 11:10:08 +01:00
Nazım Can Altınova
abc40f61c0 Replace NoViewportPercentage with a macro 2017-02-09 10:41:16 +01:00
Simon Sapin
8767b0d7cc Add font-style descriptor in @font-face 2017-02-02 19:57:40 +01:00
Hiroyuki Ikezoe
aa6372d99d Bug 1328787 - Part 9: Set Keyframe.mPropertyValues for the case where keyframe is specified. r=heycam
MozReview-Commit-ID: Ayt7IsYShl4
2017-01-29 09:07:41 +09:00
Manish Goregaokar
b5cb401aef Reduce allocator churn when parsing property declaration blocks (fixes #15060) 2017-01-18 16:31:46 -08:00
Nazım Can Altınova
77368ac48c Fix SingleSpecifiedValue in vector_longhand 2017-01-08 16:29:50 +03:00
Boris Zbarsky
8367c96c1b Bug 1298588 part 11. Pass through useful default styles to CascadePropertyFn. r=bholley 2017-01-04 23:13:49 -05:00
Manish Goregaokar
3128694bff Add spec links for margin properties, support spec links on four_sides_shorthand 2017-01-03 14:03:25 -08:00
Manish Goregaokar
6a88723409 Support logical values for float/clear 2017-01-03 14:03:10 -08:00
Manish Goregaokar
29c2db4457 Add spec argument to property helpers 2017-01-03 10:23:02 -08:00
Emilio Cobos Álvarez
b556449a96
style: Require docs in the less-straightforward part of the properties module. 2017-01-02 12:57:48 +01:00
Emilio Cobos Álvarez
277ef70d39
style: Consistently indent stuff, add a bit of documentation driving by. 2016-12-31 12:16:57 +01:00
Xidorn Quan
2a502d7377 Store unset keyword as specified value 2016-12-21 10:43:26 +11:00
Simon Sapin
137e30b825 Introduce enums for identifying CSS properties.
* `LonghandId` and `ShorthandId` are C-like enums
* `Atom` is used for the name of custom properties.
* `PropertyDeclarationId` is the identifier for `PropertyDeclaration`,
  after parsing and shorthand expansion. (Longhand or custom property.)
* `PropertyId` represents any CSS property, e.g. in CSSOM.
  (Longhand, shorthand, or custom.)

Using these instead of strings avoids some memory allocations and copies.
2016-12-09 10:56:22 -10:00
Cameron McCormack
0ff7b5f2de Support declaring keyword property Gecko coverage as inexhaustive.
This allows us to control whether the catchall case in the match expression
that maps Gecko const to Servo enum will be generated.

MozReview-Commit-ID: L65IjTONdfl
2016-12-05 21:38:58 -10:00
Manish Goregaokar
1bd6e5ff9b Support offset- logical properties 2016-11-29 09:27:13 -08:00
Ravi Shankar
dee1a65a69 Use the ParserContext along with Parser in the parse function 2016-11-27 08:49:20 +05:30
bors-servo
b3ad71353b Auto merge of #13917 - Wafflespeanut:keywords, r=Manishearth
Remove usage of 'keyword_list'

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

We're using `keyword_list` to generate code for some of the animation properties. This could be achieved with `single_keyword` (passing `vector=True`).

---

<!-- 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 build-geckolib` does not report any errors

<!-- Either: -->
- [x] These changes do not require tests because it's a cleanup

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

r? @emilio

<!-- 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/13917)

<!-- Reviewable:end -->
2016-11-17 14:34:33 -06:00
Ravi Shankar
b5bc2a1f53 Remove Mako helper: keyword_list 2016-11-17 23:41:48 +05:30
Ravi Shankar
c51db9f5f1 Remove usage of keyword_list (and prefer single_keyword) 2016-11-17 23:41:38 +05:30
bors-servo
8c6703637f Auto merge of #14223 - Manishearth:fix-logical-cascade, r=emilio
Delegate logical bitfield setters to physical to fix cascade

(fixes #14222)

Five minutes early for "tomorrow", _shrug_.

I'm not entirely sure of this fix. It depends on properties going through the cascade in source order all else being the same. I think that's the case.

Fixes wikipedia though.

r? @emilio or @SimonSapin

<!-- 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/14223)
<!-- Reviewable:end -->
2016-11-16 19:10:25 -06:00
Manish Goregaokar
3cab0e6919 Delegate logical bitfield setters to physical to fix cascade (fixes #14222) 2016-11-14 23:53:14 -08:00
Artem Biryukov
9564673b5a Fix related to #14101
Add Parse trait implementation for some structures
2016-11-12 05:26:15 +03:00
bors-servo
4b9693cf81 Auto merge of #14120 - Manishearth:logical, r=emilio
Support logical properties in style

Adds support for the logical block-end/inline-start/etc properties. These properties (like `border-block-end-color`) map to "physical" properties (e.g. `border-top-color`) depending on the writing mode.

Todo:

 - [x] Handle shorthands
 - [x] Make geckolib setters work
 - [x] Handle padding/offset logical properties
 - [x] Perhaps handle `-block-size`, `-inline-size` type logical properties?
 - [x] Tests?

This will overall add 16 new longhands and 4 new shorthands, taking a big bite out of the [remaining properties work](https://manishearth.github.io/css-properties-list/?stylo=hide&servo=hide&firefox=only&chrome=show&mdn=false&alexa=false)

f? @emilio @SimonSapin

<!-- 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/14120)
<!-- Reviewable:end -->
2016-11-11 15:41:08 -06:00
Manish Goregaokar
5fad7b0ff6 Add support for inline-size, block-size, and max-*-size/min-*-size 2016-11-11 11:56:27 -08:00
Manish Goregaokar
e34eb13d65 Support logical properties 2016-11-11 11:55:57 -08:00
Ravi Shankar
c4fc49c559 Make use of Either<A, B> for LengthOrNone 2016-11-09 13:04:26 +05:30
Ravi Shankar
6061985898 Prefer Servo-specific ToCss for all types 2016-11-07 09:14:22 +05:30
Simon Sapin
53b638c0e2 Update to string-cache 0.3 2016-11-03 16:23:05 +01:00
Cameron McCormack
2d232cecb2 Support url() values in background-image and mask-image in stylo. r=manishearth
MozReview-Commit-ID: 7IUzzVV9rOi
2016-10-28 19:29:01 +08:00
Ravi Shankar
12f429e23b Keyword argument for custom constant mapping 2016-10-26 11:56:54 +05:30
Cameron McCormack
75e97c02dc Factor out a UrlOrNone value type and make -moz-binding use it.
MozReview-Commit-ID: L57QEf40e2m
2016-10-16 11:32:57 +08:00
Nazım Can Altınova
26c98edd68 Implement parsing of all gradients 2016-10-09 22:53:15 +03:00
Manish Goregaokar
d81c6af59c Add from_computed_value() function for converting computed values to specified 2016-09-23 09:44:32 +05:30
Manish Goregaokar
f29b748a59 Fix serialization of initial/inherit shorthands 2016-08-22 22:42:44 +05:30
Manish Goregaokar
69ada0d7a3 Support multiple backgrounds in servo layout 2016-08-22 22:42:43 +05:30
Manish Goregaokar
66cdf9ae4f Support serializing vector backgrounds in shorthand form 2016-08-22 22:42:41 +05:30
Manish Goregaokar
65a8a8dccb Make most background- properties handle arrays 2016-08-22 22:42:39 +05:30
Manish Goregaokar
ce9640a48e Support possibly-vector keyword properties 2016-08-22 22:42:38 +05:30
David Raifaizen
3831c0650c Adding support for correct shorthand serialization 2016-08-16 22:28:51 -04:00
Emilio Cobos Álvarez
9e88a495c8
style: Introduce a generic way of gathering information from the cascade, and use it for viewport units. 2016-08-16 10:58:16 -07:00
Manish Goregaokar
c8bff6151e
Resync stylo bindings
Now at gecko-dev acf1cc9adeffe040dcdf7b7cf454cdd9657761e5
2016-07-26 15:14:24 +05:30
Simon Sapin
4b7060554b Rename ComputedValuesStruct to ComputedValues.
Doing this in a separate commit avoids mixups
with the ComputedValues trait that the previous commit removed.
2016-07-20 08:42:45 +02:00