Commit graph

408 commits

Author SHA1 Message Date
karan sharma
f30537ba2b Change code for serialization of {box,text}-shadow so blur-radius
can be parsed as non-negavite
2017-03-13 12:26:59 +05:30
austinprete
a2074f2653 Implement parsing/serialization for caret-color 2017-03-05 10:52:32 -07:00
Xidorn Quan
2e07ce7e84 Add get_initial_specified_value to many longhands 2017-02-28 15:20:34 +11:00
Simon Sapin
0f2d000a23 Borrow input to match_ignore_ascii_case!
In cssparser version 0.11, this macro will stop implicitly borrowing its
own input.
2017-02-26 10:40:09 +01:00
bors-servo
26de7c6bc4 Auto merge of #14740 - glasserc:extremum-length, r=Manishearth
Add support for keyword values for min-width and max-width

This is a follow-up to #14432 which got closed and can no longer be re-opened.

This PR aims to add support for keyword-values max-content, min-content, fit-content, and fill-available to the properties that use them, namely min-width, min-height, max-width, and max-height.

It's still untested because I still haven't figured out how to do that. I guess I should write or find some web page that uses these properties.

Refs #13821.

<!-- 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: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #13821  (github issue number if applicable).

<!-- Either: -->
- [ ] 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/14740)
<!-- Reviewable:end -->
2017-02-24 14:08:58 -08:00
Nazım Can Altınova
d7c227f614
Fix parsing of ClipRect 2017-02-25 00:10:43 +03:00
Ethan Glasser-Camp
dd4f331603 Add support for MaxLength
This builds on the ExtremumLength type from the previous commit.
2017-02-24 15:44:49 -05:00
Ethan Glasser-Camp
76de979231 Implement a MinLength type
Implement an ExtremumLength type which contains all the enumerated
keyword values for min-width, min-height, max-width, and
max-height. Then, implement a MinLength which can be used for min-width
and min-height. So far this just maps to Gecko values.

Refs #13821.
2017-02-23 16:28:26 -05:00
Ravi Shankar
c70fb42cea Add docs for grid types 2017-02-20 14:31:30 +05:30
Ravi Shankar
048f1f3316 Auto-generate parsing/serialization code for grid-auto-{rows,columns} 2017-02-20 14:30:46 +05:30
Ravi Shankar
b55cc7f9da Computed value for TrackBreadth and TrackSize 2017-02-20 14:29:45 +05:30
bors-servo
72b76458b7 Auto merge of #15606 - mbrubeck:align-items, r=Manishearth
stylo: Implement align-items and justify-items

Stylo-only patch to match Gecko property support. Part of #15001. r? @Manishearth

<!-- 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/15606)
<!-- Reviewable:end -->
2017-02-18 22:26:06 -08:00
Manish Goregaokar
ff08de8ad1 stylo: Support stroke-dasharray and stroke-dashoffset
MozReview-Commit-ID: 4QKKzJ1DVYP
2017-02-18 02:43:36 -08:00
Manish Goregaokar
51b03fbc7d stylo: Add Gecko bindings for <paint>, use for stroke/fill
MozReview-Commit-ID: 4QKKzJ1DVYP
2017-02-18 02:42:57 -08:00
Manish Goregaokar
fabc1b875b stylo: Add SVGPaint type for <paint>
MozReview-Commit-ID: 4QKKzJ1DVYP
2017-02-18 02:42:55 -08:00
Matt Brubeck
0a0dd11f50 stylo: Implement align-items and justify-items 2017-02-16 15:52:34 -08:00
Matt Brubeck
4de480ec9b style: Implement 'align-self' and 'justify-self' 2017-02-16 13:35:47 -08:00
bors-servo
357bf3b85a Auto merge of #15518 - emilio:color, r=SimonSapin
style: Unbox a bunch of color properties.

This builds on https://github.com/servo/rust-cssparser/pull/118.

<!-- 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/15518)
<!-- Reviewable:end -->
2017-02-14 11:43:16 -08:00
Emilio Cobos Álvarez
0c102e2350
style: Unbox a bunch of color properties.
This builds on https://github.com/servo/rust-cssparser/pull/118.
2017-02-14 20:18:31 +01:00
Matt Brubeck
c70167d17c Stylo: Implement align-content and justify-content 2017-02-14 08:58:55 -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
a095565a8c stylo: Implement scroll-snap-destination
MozReview-Commit-ID: 6mr4ktfeEGT
2017-02-09 10:54:19 -08:00
Nazım Can Altınova
abc40f61c0 Replace NoViewportPercentage with a macro 2017-02-09 10:41:16 +01:00
Ravi Shankar
590c9579f0 Change LengthOrPercentage to make use of NoCalcLength 2017-01-29 02:30:25 +05:30
Ravi Shankar
377a23df50 Refactor and modify stuff to make use of NoCalcLength 2017-01-29 02:04:24 +05:30
Ravi Shankar
4035bbd738 Split the Length type (introduce NoCalcLength) 2017-01-28 23:33:00 +05:30
Manish Goregaokar
f59557d2f2 Box CalcLengthOrPercentage to reduce inline size of PropertyDeclaration(s) 2017-01-17 08:09:54 -08:00
Emilio Cobos Álvarez
f37aa12927
style: Prevent more missing docs in the values module. 2016-12-31 12:17:02 +01:00
Ravi Shankar
6d9aed9ac3 Add gecko glue for grid-{row,column}-{start,end} 2016-12-16 13:07:08 +05:30
Ravi Shankar
7976640251 Add GridLine type for grids 2016-12-16 13:03:27 +05:30
Shing Lyu
64ecb33e17 Reuse box-shadow code for drop-shadow filter 2016-12-13 14:47:02 +08:00
Thiago Pontes
206f4ea5b8 use Either type for UrlOrNone
fix test-tidy errors

fix style unit test

use the Parse trait instead of ParseWithContext

fix stylo test and geckolib build

move all specified url parse code to parse trait and remove refs to unused type
2016-11-30 11:43:14 -05:00
Ravi Shankar
dee1a65a69 Use the ParserContext along with Parser in the parse function 2016-11-27 08:49:20 +05:30
Artem Biryukov
9564673b5a Fix related to #14101
Add Parse trait implementation for some structures
2016-11-12 05:26:15 +03:00
Emilio Cobos Álvarez
5f2e7af864
style: Centralize specified url value handling, and refcount urls. 2016-11-10 13:15:21 +01: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
Nazım Can Altınova
7720fe4d9c Move LengthOrNumber to style/values and implement GeckoStyleCoordConvertible 2016-11-06 20:08:31 +03:00
Yuki Izumi
f33f5605ba
Refactor style lengths per #13584 2016-11-06 14:11:37 +11:00
Emilio Cobos Álvarez
de4fe6e2b6 Concurrent rule tree, v1
This patch introduces infrastructure for the rule tree, and constructs it.

We don't use it yet, nor have good heuristics for GC'ing it, but this should not
happen anymore once we store the rule node reference in the node.

I haven't messed up with memory orders because I want to do a try run with it,
then mess with them.

Take down the ApplicableDeclarationsCache, use the rule tree for doing the cascade.
2016-11-05 17:29:52 +01:00
Ting-Yu Lin
0fc38f79d6 Use enum BorderWidth as SpecifiedValue
Use enum BorderWidth instead of a tuple-like struct to store the specified
value. BorderWidth is needed to be used in both longhand and shorthand
border width properties, so I put it in `specified` module.

Fixed #13869.
2016-10-26 16:24:12 +08:00
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
Manish Goregaokar
2bde9462b1 Add safer bindings for RefPtr 2016-10-14 00:44:06 +05:30
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
2f69e7ff8c Use ComputedValueAsSpecified wherever possible 2016-09-22 18:45:34 +05:30
UK992
93a103ba73 Reorder use statements 2016-09-09 04:55:19 +02:00
Emilio Cobos Álvarez
d02c5b0281
style: Don't incorrectly clamp values in calc that might not be only lengths.
Expressions with percentages may be negative or positive at computed value time.

So, we can only clamp lengths at computed value time, which is what the other
browsers do.
2016-09-01 23:39:40 -07:00
Emilio Cobos Álvarez
2617d15ed6
style: Properly track whether negative values of calc() are allowed
In order to clamp them at computed value time.
2016-08-30 19:17:16 -07:00
Emilio Cobos Álvarez
be7a44315d
style: Allow calc in media queries. 2016-08-30 13:48:55 -07:00