Commit graph

6718 commits

Author SHA1 Message Date
Simon Sapin
6d0e48f6cc Remove some type aliases that are now just re-exports. 2016-07-20 08:42:47 +02:00
Simon Sapin
5c70dfab01 Have a concrete SelectorImpl type everywhere in the style crate.
It is conditionally compiled to one implementation or the other
(Gecko or Servo) with `#[cfg(…)]`.
2016-07-20 08:42:46 +02:00
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
b2a7e44373 Move ServoSelectorImpl to a dedicated module. 2016-07-20 08:40:53 +02:00
Simon Sapin
2f967893f3 Move geckolib/selector_impl.rs -> style/gecko_selector_impl.rs 2016-07-20 08:40:49 +02:00
Simon Sapin
db3607471f Move geckolib/properties.mako.rs to style/properties/gecko.mako.rs 2016-07-20 08:40:22 +02:00
Simon Sapin
2c1f7c8a85 Move geckolib/values.rs to style/gecko_values.rs 2016-07-20 08:33:52 +02:00
Manish Goregaokar
f51b115db0
Address review comments 2016-07-19 11:29:13 +05:30
Manish Goregaokar
704d7a01c9
Handle Calc refcounting 2016-07-19 11:29:11 +05:30
Manish Goregaokar
67bcb96cea
Add glue for calc values 2016-07-19 11:29:07 +05:30
bors-servo
d28f2b8904 Auto merge of #12361 - stshine:blockify-flex-item, r=pcwalton
Blockify elements in a flex container

<!-- Please describe your changes on the following line: -->
The is one of my pull requests that implement basic flexible box layout.
As the spec stated in https://drafts.csswg.org/css-flexbox/#flex-items ,
A inline-level child of a flex container should be converted to its block equivalent, according to CSS2.1 § 9.7.

---
<!-- 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 flexbox is not actually implemented yet.

<!-- 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/12361)
<!-- Reviewable:end -->
2016-07-18 11:21:04 -07:00
Shing Lyu
f754cacbd5 Only restyle viewport-relative nodes on viewport size change 2016-07-18 11:01:42 +08:00
Manish Goregaokar
e21828080b
Error when non-allow_empty property is empty 2016-07-16 11:01:03 +05:30
Manish Goregaokar
a37eb82da8
Use allow_empty vector longhand for box-shadow 2016-07-15 15:15:28 +05:30
Manish Goregaokar
b6edae2f5e
Add allow_empty to vector_longhand 2016-07-15 15:15:26 +05:30
Manish Goregaokar
34c82d6e78
Replace gecko_autoarray_longhand with configurable vector_longhand 2016-07-15 15:15:23 +05:30
Alan Jeffrey
62e95c5a61 All our Cargo.toml files should contain an MPL-2.0 license field. 2016-07-14 10:26:34 -05:00
Manish Goregaokar
209255b20a Address review comments 2016-07-14 12:35:34 +05:30
Manish Goregaokar
38b57c435d Make background-image an array for stylo 2016-07-14 12:34:07 +05:30
Manish Goregaokar
b1a3831bf6 Add framework for properties which are single elements in servo and arrays in gecko 2016-07-14 12:34:04 +05:30
Manish Goregaokar
2091981db8 Some fixes in style 2016-07-12 20:00:24 +05:30
Manish Goregaokar
3ead9cc67b Improve mach clippy, add plugins to style/util 2016-07-12 19:59:58 +05:30
bors-servo
9b01a4cc97 Auto merge of #12382 - stshine:anonymous-block, r=SimonSapin
layout: Clear non-inherited properties on anonymous block

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

This is one of my pull requests that imlement basic flexible box layout.
This pull request adds a `modify_style_for_anonymous_flow()` function to use initial values for non-inherited properties and parent values for inherited properties as the flow style. It also set border and outline to zero and set the display property from the parameter. This function may also be reused to modify style of anonymous table object in the future.
Part of code comes from `cascade_anonymous()` from @SimonSapin .

---
<!-- 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 flexbox is not implemented yet.

<!-- 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/12382)
<!-- Reviewable:end -->
2016-07-11 16:19:52 -07:00
Pu Xingyu
d40e6c5738 Clear non-inherited properties on anonymous block
Add a modify_style_for_anonymous_flow() function to use initial values
for non-inherited properties and parent values for inherited properties
as the block style. It also set border and outline to zero and set the
display property from the parameter.
2016-07-12 07:17:31 +08:00
Pu Xingyu
6d0756512d Blockify elements in a flex container
A inline-level child of a flex container should be converted to its
block equivalent. according to CSS2.1 § 9.7.
2016-07-12 07:13:25 +08:00
bors-servo
c3a8cbbd38 Auto merge of #12385 - Ms2ger:arc_ptr_eq, r=SimonSapin
Move arc_ptr_eq to style.

<!-- 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/12385)
<!-- Reviewable:end -->
2016-07-11 05:11:48 -07:00
Ms2ger
cbfe77cee1 Move some unit type definitions to style_traits. 2016-07-11 12:14:27 +02:00
Ms2ger
9f13278b77 Move arc_ptr_eq to style. 2016-07-11 12:13:12 +02:00
bors-servo
beaef005c2 Auto merge of #11873 - notriddle:rotate_anim, r=glennw
Rotate animation

Add rotation interpolation code for the case where their direction vectors are equal.
___

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #11808 (github issue number if applicable).
- [X] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11873)
<!-- Reviewable:end -->
2016-07-10 16:30:48 -07:00
bors-servo
35a23bfef3 Auto merge of #12338 - upsuper:win-geckolib-fix, r=bholley
Fix geckolib build for Windows

It contains several fixes to make `./mach build-geckolib` work on Windows.

<!-- 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/12338)
<!-- Reviewable:end -->
2016-07-08 11:14:48 -07:00
Ms2ger
e7f9959ad9 Fix a build warning in animation.rs. 2016-07-08 16:44:50 +02:00
Ms2ger
8dd711d3db Move util::cache to style. 2016-07-08 16:44:47 +02:00
Xidorn Quan
6519d06b23 Replace windows path sep with unix sep
It seems python in msys2 has some weird behavior. For __file__, it
returns a string which uses windows-style separator '\', however,
os.path.dirname only recognizes the unix-style separator '/', and
consequently, the path of Mako is not added properly.
2016-07-08 18:51:05 +10:00
Xidorn Quan
6389107e19 Detect python2.7.exe on windows
Latest python2 package on msys2 installs the executable file to
python2.7.exe rather than python27.exe.
2016-07-08 18:50:59 +10:00
Emilio Cobos Álvarez
3a4539f043
style: stylistic nit. be consistent on how we write inline annotations. 2016-07-07 16:05:30 -07:00
Emilio Cobos Álvarez
8ba676533b
style: Fix timing-function overriding from the keyframe declaration list.
The previous behavior is plain wrong, since that array has always at least one
element, so we effectively couldn't specify anything else than "ease" in our
animations.
2016-07-07 16:05:28 -07:00
Emilio Cobos Álvarez
8bbebd0514
style: bonus: Fix parsing of steps() function.
Still doesn't work properly (this also happened with transitions).

This is spec'd in:
https://www.w3.org/TR/css3-transitions/#transition-timing-function
2016-07-07 16:05:26 -07:00
Emilio Cobos Álvarez
411ae84908
style: Add support to the animation shorthand and fix parsing of animation-name. 2016-07-07 16:05:22 -07:00
bors-servo
0d76cf8e5c Auto merge of #11948 - stshine:flex-shorthand-properties, r=emilio
Support 'flex' and 'flex-flow' shorthand properties

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

Support the `flex` and `flex-flow` shorthand properties in
servo. Currently they are marked as experimental, so they are added to
`__dir__.ini`.
Thanks SimonSapin and jdm for help :)

---
<!-- 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] There are tests for these changes

<!-- 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="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11948)
<!-- Reviewable:end -->
2016-07-05 20:08:07 -07:00
Bobby Holley
187a47d89d Remove get_attr from TElement. \o/ 2016-07-05 18:03:41 -07:00
Bobby Holley
1d8d1cb9d9 Upgrade rust-selectors. 2016-07-05 18:03:40 -07:00
Bobby Holley
364c8e2976 Add attr_equals to TElement.
Same reasons as the previous patch.
2016-07-05 18:03:38 -07:00
Bobby Holley
96af00fbb9 Add has_attr method to TElement.
If this is all the information the caller needs, we can get it from gecko without
worrying about atomization and string conversions.
2016-07-05 18:03:36 -07:00
Bobby Holley
7947afc699 Remove get_attrs from TElement.
This should just be a helper.
2016-07-05 18:03:35 -07:00
Bobby Holley
a0c425fbef Use each_class rather than get_attr when comparing class lists during style sharing. 2016-07-05 18:03:34 -07:00
Bobby Holley
7f2a0a1547 Regenerate bindings. 2016-07-05 18:03:33 -07:00
Cameron McCormack
fd09035c65 Disable align-items in geckolib. 2016-07-05 17:34:57 -07:00
Pu Xingyu
595eed166f Add tests and small fixes for flexbox shorthands 2016-07-06 06:01:41 +08:00
Simon Sapin
2d52b13f2f Make geckolib possible to build on stable Rust 2016-07-05 15:37:16 +02:00