Commit graph

592 commits

Author SHA1 Message Date
Manish Goregaokar
66c8cd9cf3 stylo: support corner linear-gradients 2016-09-04 07:47:11 +05:30
Manish Goregaokar
04c5d05727 stylo: support background-size 2016-09-04 07:47:10 +05:30
bors-servo
927cd8ebf7 Auto merge of #12991 - Manishearth:more-arc-safety, r=mystor,emilio
Add sugar for handling borrowed and owned types

Implements the changes outlined in https://github.com/servo/servo/pull/12826#discussion_r75074985

<s>Also gets things ready for the Unique/Borrowed bindings</s>

WIP for borrowed and unique in the same PR. Still need to convert all the rest of the gecko types to use the new wrappers.

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/12991)
<!-- Reviewable:end -->
2016-09-02 22:42:21 -05:00
bors-servo
58205f1a78 Auto merge of #13163 - Manishearth:conditional-compilation, r=bholley
Use conditional compilation for stylo properties; output unimplemented logs for all properties

Till now we were only emitting unimplemented property logs for properties which servo implements but stylo doesn't.
This list is getting smaller, and we really should be emitting this for any unexpected property we encounter.

I also made it so that longhands which stylo does not implement will not be compiled in stylo builds; instead of what we currently do,
which is to parse them and then basically ignore the result.

There are still a few exceptions -- we generate stubs for properties that are parts of shorthands because otherwise we'd have to add fiddly conditional compilation to the shorthand code.

r? @bholley

cc @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/13163)
<!-- Reviewable:end -->
2016-09-02 21:45:08 -05:00
Manish Goregaokar
c965beb3d9
Use conditional compilation for stylo properties 2016-09-02 17:45:48 +05:30
Manish Goregaokar
5ec2226f5b
Don't use mem::uninitialized() for making calc values
We had code relying on `nsStyleCoord::set()` being leaky (like it was before we
patched up the calc bindings). Added `nsStyleCoord::null()` for this use case
since it's not possible to construct directly anymore.
2016-09-02 11:39:52 +05:30
Manish Goregaokar
f72cd7ffbc
Review fixes and bindings resync 2016-09-02 08:58:41 +05:30
Manish Goregaokar
0d4c5674ec
Handle RawGeckoElement and friends, add support for types which are used in both maybe-null and non-null forms 2016-09-02 08:56:51 +05:30
Manish Goregaokar
9f6b772bbb
Make Arc helpers into methods 2016-09-02 08:56:42 +05:30
Manish Goregaokar
85332d5790 stylo: Support box-shadow 2016-08-30 08:04:04 +05:30
Manish Goregaokar
7fae87d687 stylo: Support text-shadow 2016-08-30 08:04:03 +05:30
Manish Goregaokar
a98c0fc037 Fill extra layers in background style struct before handing off to Gecko 2016-08-22 22:42:48 +05:30
Manish Goregaokar
979a2798d5 Make Position a gecko-only vector longhand 2016-08-22 22:42:40 +05:30
Manish Goregaokar
65a8a8dccb Make most background- properties handle arrays 2016-08-22 22:42:39 +05:30
bors-servo
daee53cb76 Auto merge of #12918 - hsinewu:12902-typedefs, r=Manishearth
12902 typedefs

<!-- Please describe your changes on the following line: -->
Using type alias instead of newtype.
Removing duplicated implementation, it's already inherited.
No more type constructors and foo.0
---
<!-- 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 #12902 (github issue number if applicable).

<!-- Either: -->
- [X] These changes do not require tests because it's refactoring.

<!-- 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/12918)
<!-- Reviewable:end -->
2016-08-22 06:01:03 -05:00
hsinewu
ef9a690c9c Refactor: use type alias instead of newtype 2016-08-22 09:36:19 +08:00
bors-servo
609d47b44f Auto merge of #12878 - Manishearth:clip-path, r=heycam
stylo: Support clip-path

Todo:

 - [x] `set_clip_path` (probably needs a bunch of gecko bindings for running constructors/destructors)
 - [ ] Ensure that I've ordered the coordinates correctly
 - [ ] Check that it works
 - [x] Might want to convert NS_STYLE_FILL_RULE and NS_RADIUS to enum classes

Depends on:

 - https://github.com/servo/rust-bindgen/pull/29
 - https://github.com/Manishearth/gecko-dev/compare/servo:stylo...Manishearth:clip-path

<!-- 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/12878)
<!-- Reviewable:end -->
2016-08-19 14:24:08 -05:00
Manish Goregaokar
3895b7118e
Handle clip-path in stylo 2016-08-19 23:36:37 +05:30
Emilio Cobos Álvarez
46afc56c41
stylo: Implement support for the contents property. 2016-08-18 15:59:38 -07:00
Emilio Cobos Álvarez
d85a60e366
stylo: Use the improved version of Gecko_GetStyleContext() 2016-08-18 15:56:03 -07:00
Manish Goregaokar
0d4d1b539e Add safer bindings for refcounted types across ffi 2016-08-17 12:30:31 +05:30
Emilio Cobos Álvarez
babb2b7160
stylo: Remove misleading comments re. break-before and break-after.
They're alias, and the deprecated property is page-break-xxx, not break-xxx.
2016-08-15 22:59:54 -07:00
Emilio Cobos Álvarez
6bce4c8c20
stylo: Use Arc::get_mut().unwrap() instead of make_mut.
It's infallible, so no point in using make_mut.
2016-08-15 22:59:35 -07:00
bors-servo
a22913569c Auto merge of #12795 - Wafflespeanut:word_spacing, r=Manishearth
Support 'word-spacing' for geckolib

**These changes haven't been tested yet!**

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

- [ ] There are tests for these changes

<!-- 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/12795)
<!-- Reviewable:end -->
2016-08-11 22:02:01 -05:00
Bobby Holley
1cd76c2917 Handle enum classes for clonable properties. 2016-08-10 12:07:10 -07:00
Ravi Shankar
69c422f581 Support 'word-spacing' for geckolib 2016-08-10 15:03:28 +05:30
Bobby Holley
8f991f76bd stylo: Use AtomicUsize to store our initial computed values. 2016-08-05 13:42:38 -07:00
bors-servo
0fc0db67c6 Auto merge of #12680 - Manishearth:basic-shape, r=SimonSapin
style: Add support for parsing and serialization of <basic-shape>s

Still WIP: I still need to use this somewhere and make serialization minimal. I'm not sure if I should do either in this PR.
The only other browser that handles basic shapes doesn't serialize correctly either (https://bugzilla.mozilla.org/show_bug.cgi?id=1290864), so that's not something we need to get done now.

As far as using this somewhere, I have the following options:

 - Merge this now, work on using it in stylo in a followup.
 - Just write extensive unit tests for parsing/serialization for now (stylo in a followup)
 - Use this for clip-path in stylo only (which I intend to do anyway, just not sure if I should do it in this PR)
 - Use this for clip-path in Servo (I'd rather not do this; this would be a huge change requiring a lot more layout knowledge than I currently have)

Thoughts? Review? @SimonSapin @bholley

<!-- 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/12680)
<!-- Reviewable:end -->
2016-08-05 06:27:24 -05:00
Bobby Holley
b916ad0a85 Convert currentColor crash into a warning. 2016-08-03 17:55:02 -07:00
Bobby Holley
f0f39904a2 Explicitly allocate and deallocate our initial computed values.
This allows us to trigger style struct destructors before Gecko's leak checking
runs.
2016-08-03 17:20:21 -07:00
Manish Goregaokar
44e33bcdc5
Move Position into its own values module 2016-08-02 15:57:23 +05:30
bors-servo
f16aac0e5d Auto merge of #12651 - heycam:background-position, r=Manishearth
Add support for background-position in geckolib.

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

r? @Manishearth

---
<!-- 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 this is a geckolib-only change

<!-- 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/12651)
<!-- Reviewable:end -->
2016-08-01 20:41:56 -05:00
Cameron McCormack
77e57aab5b Add support for background-position in geckolib. 2016-07-29 17:12:50 +08:00
bors-servo
7e39efa2df Auto merge of #12631 - Manishearth:stylo-unsafe-coord, r=bholley
stylo: Use unsafe accessors for coord data

depends on https://bugzilla.mozilla.org/show_bug.cgi?id=1290061

r? @bholley

<!-- 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/12631)
<!-- Reviewable:end -->
2016-07-29 03:38:14 -05:00
Manish Goregaokar
a0f203a3a8
stylo: Use unsafe accessors for coord data; regen bindings 2016-07-29 13:13:36 +05:30
Cameron McCormack
baa339f4af Store UrlExtraData in {specified,computed}::Image::Url. 2016-07-29 14:22:35 +08:00
Manish Goregaokar
c8bff6151e
Resync stylo bindings
Now at gecko-dev acf1cc9adeffe040dcdf7b7cf454cdd9657761e5
2016-07-26 15:14:24 +05:30
Manish Goregaokar
73d7db0d5e
Make nsStyleUnion sugar use traits 2016-07-21 13:35:47 +05:30
Manish Goregaokar
6e9a68a0db
Introduce safer layer of sugar for nsStyleUnion 2016-07-20 18:28:07 +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
Simon Sapin
789807b7b0 Remove the ComputedValue traits and style_struct_traits 2016-07-20 08:42:40 +02:00
Simon Sapin
db3607471f Move geckolib/properties.mako.rs to style/properties/gecko.mako.rs 2016-07-20 08:40:22 +02:00
Renamed from ports/geckolib/properties.mako.rs (Browse further)