Commit graph

321 commits

Author SHA1 Message Date
bors-servo
2c674d0397 Auto merge of #11192 - perlun:remove-unused-imports, r=Manishearth
Removed unused imports

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #11185
- [X] These changes do not require tests because it only removes dead code.

----

This fixes #11185.

<!-- 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/11192)
<!-- Reviewable:end -->
2016-05-15 15:41:16 -07:00
Per Lundberg
2f7ed1d73e Removed unused imports
This fixes #11185.
2016-05-15 22:24:26 +03:00
Aneesh Agrawal
5457169871 Rename SVGInherited to InheritedSVG 2016-05-14 17:44:53 -04:00
Cameron McCormack
b3a1f5f071 Support text-align in geckolib.
We don't yet support the 'unsafe' keyword, which isn't in a spec yet, and which
would require slightly more complex parsing.
2016-05-12 09:17:27 +10:00
Cameron McCormack
ad7cfcbb7e Support -moz-outline-radius shorthand in geckolib. 2016-05-11 11:10:44 +10:00
Cameron McCormack
2b8f809852 Allow shorthands to be restricted to specific products. 2016-05-11 11:10:42 +10:00
Cameron McCormack
a12493f5fe Support -moz-outline-radius-* in geckolib. 2016-05-11 11:10:41 +10:00
bors-servo
b29ae6383a Auto merge of #11018 - bholley:list_style_type, r=mbrubeck
Geckolib: Implement list-style-type

Corresponding Gecko patch: https://bugzilla.mozilla.org/show_bug.cgi?id=1269933

<!-- 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/11018)
<!-- Reviewable:end -->
2016-05-05 12:23:37 -07:00
bors-servo
8bc4785bed Auto merge of #10999 - heycam:move-width-height, r=SimonSapin
Move width and height from Box to Position.

This helps with style struct alignment between Servo and Gecko.

<!-- 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/10999)
<!-- Reviewable:end -->
2016-05-04 19:52:25 -07:00
bors-servo
ec5f826d18 Auto merge of #10998 - bholley:font_weight_and_logging, r=mbrubeck
Geckolib: implement font-weight and logging support

<!-- 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/10998)
<!-- Reviewable:end -->
2016-05-04 18:37:26 -07:00
Bobby Holley
f1f36efc96 Geckolib: Implement list-style-type. 2016-05-04 14:23:17 -07:00
Cameron McCormack
550d780e17 Move width and height from Box to Position.
This helps with style struct alignment between Servo and Gecko.
2016-05-04 11:06:42 +10:00
Bobby Holley
9fdb791e93 Geckolib: Implement font-weight. 2016-05-03 17:40:03 -07:00
Cameron McCormack
330c47f78e Support {flood,lighting,stop,text-decoration}-color in geckolib. 2016-05-04 09:44:12 +10:00
Cameron McCormack
53649b19d0 Support flex-{grow,shrink}, stroke-miterlimit and -moz-box-flex in geckolib. 2016-05-03 10:01:31 +10:00
Cameron McCormack
d71e5c8b3d Support {fill,stroke,stop,flood}-opacity in geckolib. 2016-05-03 10:01:29 +10:00
Cameron McCormack
0f2dc53b0a Factor out opacity property to use an Opacity type. 2016-05-03 10:01:28 +10:00
Cameron McCormack
d69763b0c1 Generate geckolib setters for properties with simple predefined types. 2016-05-03 10:01:28 +10:00
bors-servo
160a44c286 Auto merge of #10863 - perlun:improve-mako-file-structure-v4, r=SimonSapin
Extracted shorthands to separate files.

Following up on #10813, here is a similar extraction of the shorthand stuff as well.

I've deliberately tried to keep things similarly structured as in the longhand files. I.e. if a given property is in e.g. longhand/box.mako.rs, the shorthand stuff that relates to the same property is in shorthand/box.mako.rs and so forth.

----

The file is now down from ~7000 LoC to ~1750. A big improvement in my eyes, but there's still room for improving more. However, that shouldn't be done until we've had a bit of discussion about it. What we've done so far has been more-or-less obvious (after resolving the underlying Python/Mako issues with how to get things to properly communicate when things got split into multiple files etc). The remaining stuff is basically a plethora of anything from enums to structs to impls to... you name it.

One way to try and sort this out is to continue abusing Mako %include:s for this. I'm not sure it's the right way, but it would be a reasonably _easy_ way to do it. Another way would be to use Rust modules/crates etc. for sorting it out. I feel like too much of a novice on the Rust side of stuff yet to have any sensible opinions on how to get that done, so here I'd very much like suggestions from other people in the project.

(This is more of an entry point for discussion, and we could very well move that to a separate issue if you like. I think the more important short-term point is to try and get this merged. 😊 Please let me know if you feel it is OK, and if not, feel free to suggest adjustments.)

<!-- 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/10863)
<!-- Reviewable:end -->
2016-04-29 10:57:21 -07:00
Cameron McCormack
dafc683aef Specialize text node style resolution so geckolib can avoid inheriting non-inherited structs. 2016-04-29 10:07:59 +10:00
Cameron McCormack
88f51af3f8 Add Servo_GetStyleFoo functions to get style structs from GeckoComputedValues.
While we're here we also:

* remove any code conditional on style_struct.gecko_ffi_name, since all
  style structs now do have a corresponding Geckos struct

* add new UIReset and XUL style structs, so that all Gecko structs are
  now present (apart from Variables, which is special)
2016-04-27 17:13:26 +10:00
Per Lundberg
38f90a3e2e Extracted shorthands to separate files.
I've deliberately tried to keep things similarly structured as in the longhand files. I.e. if a given property is in e.g. longhand/box.mako.rs, the shorthand stuff that relates to the same property is in shorthand/box.mako.rs and so forth.
2016-04-26 23:12:35 +03:00
Per Lundberg
4e8831457a Moved the rest of the longhand structs to separate files.
Sorry for the bulk size of this; I know already it's not going to be a fun thing to review. Nevertheless, it should be done so we finalize the split of this huge file into smaller, more maintable parts.

The content of stuff being moved to separate files is unchanged. Only some minor formatting changes have been made and similar, but nothing of particular interest. IMHO it should be safe to merge if all the tests are fine.
2016-04-25 21:36:58 +03:00
Daniel Robertson
2d9d31ee04
Add style property for flex-basis
Add the style property for flex-basis. The property should allow all
values acceptable for `width`|`height` with the addition of `content`.
2016-04-24 14:04:40 -04:00
Bobby Holley
1a727225a6 Unstub text-orientation.
The spec has changed a bit since the servo implementation. We still need to alias
sideways-right to sideways and add other writing modes, but we can do that later.
2016-04-21 23:57:41 -07:00
Bobby Holley
bba4447637 Support the text-decoration-style property. 2016-04-21 23:57:35 -07:00
Bobby Holley
980c814e2a Manually implement the display property for now. 2016-04-21 23:57:31 -07:00
Bobby Holley
cc35d4fcce Get rid of some of our custom additional methods in favor of clonable keywords.
Now that I'm pretty convinced we can auto-generate these and make them fast, we can
ditch the additional complexity.
2016-04-21 23:57:29 -07:00
Bobby Holley
456b05e9cf Make predefined_type use kwargs. 2016-04-21 23:57:28 -07:00
Bobby Holley
a4ee11da0a Track cloning separately from additional_methods and auto-generate clone methods. 2016-04-21 23:57:27 -07:00
bors-servo
b080da474f Auto merge of #10791 - servo:explicit-python-path, r=KiChjang
Blind attempt at fixing a Python import error on Windows.

See #10789.

<!-- 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/10791)
<!-- Reviewable:end -->
2016-04-21 17:26:11 -07:00
Per Lundberg
4643737a1b Applied a bunch of suggestions from Simon. 2016-04-21 22:42:35 +03:00
Per Lundberg
d0489f1160 Improve properties.mako.rs file structure, take 2
This is a new attempt of #10586, after Simon Sapin's great cleanups in #10749 has landed. I have adjusted the changes to the new structure that was introduced, and also only done a few of the longhand ones. Will certainly continue on this as soon as we have a basic agreement that this style is reasonable.
2016-04-21 22:42:35 +03:00
Simon Sapin
ad95a1dd23 Blind attempt at fixing a Python import error on Windows.
See #10789.
2016-04-21 19:46:23 +02:00
Simon Sapin
515c5ef540 Tidy 2016-04-20 17:19:25 +02:00
Simon Sapin
2d8c17e600 Extract some Python code from properties.mako.rs into a separate file. 2016-04-20 15:30:27 +02:00
Simon Sapin
7787b21e30 Move Mako-related files into a new sub-directory.
There’s gonna be more of them.
2016-04-20 14:49:27 +02:00
Simon Sapin
6e95bd8e50 style::properties : move generated file out of source tree, use new-style Cargo build script. 2015-01-30 15:08:30 +01:00
Simon Sapin
d13d36f57f End the libstyle 'pub use' madness. 2015-01-30 15:08:29 +01:00
Simon Sapin
493a9e6a89 Bring CSS parse error reporting back. (Still off by default. Enable with RUST_LOG=style.) 2015-01-30 15:07:29 +01:00
Simon Sapin
966af0030a Upgrade to rust-cssparser master.
* Use associated types
* Avoid mutation to gather parsing results.
2015-01-30 15:07:29 +01:00
Patrick Walton
5fdaba05a6 layout: Implement text-align: justify and text-justify per
CSS-TEXT-3 § 7.3.

`text-justify: distribute` is not supported.

The behavior of `text-justify: none` does not seem to match what Firefox
and Chrome do, but it seems to match the spec.

Closes #213.
2015-01-29 17:00:41 -08:00
Ms2ger
505159a464 Import the util crate as util rather than servo_util.
This used to conflict with the util crate from the standard library, which
has long since been removed.

The import in layout has not been changed because of a conflict with the
util mod there.
2015-01-29 12:16:41 +01:00
bors-servo
c8e68fa45c auto merge of #4592 : pcwalton/servo/text-overflow, r=mbrubeck
Only the one-value syntax is supported for now.

r? @mbrubeck
2015-01-28 17:24:50 -07:00
Patrick Walton
0f8e436745 layout: Implement text-overflow: ellipsis per CSS-UI-3 § 6.2.
Only the one-value syntax is supported for now.
2015-01-28 16:23:31 -08:00
Patrick Walton
abddfa742f gfx: Implement font-stretch per CSS3-FONTS § 3.3 in the Core Text
font backend.
2015-01-28 12:42:52 -08:00
Josh Matthews
95fc29fa0d Update rustc to 00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev. 2015-01-28 10:16:49 +10:00
Simon Sapin
d034a6c6bc Port to the new cssparser.
https://github.com/servo/rust-cssparser/pull/68
2015-01-21 22:23:46 +01:00
Ms2ger
01ed338746 Move to to_owned rather than into_string.
into_string has been removed from Rust.
2015-01-20 14:49:07 +01:00
Bruno de Oliveira Abinader
dc008977f9 Share supported CSS properties between style and CSSStyleDeclaration
Avoids duplicated code when implementing the CSS properties accessors in
CSSStyleDeclaration WebIDL. Servo internal CSS properties are not
accessible.

CSS property "float" is unnacessible because we currently lack support
for BinaryName IDL annotation (#4435).

Fixes #4429, #4430.
2015-01-19 13:21:03 -04:00