Commit graph

1145 commits

Author SHA1 Message Date
Keith Yeung
ff98e44654 Add -moz-user-select 2016-05-17 04:12:20 -04:00
Keith Yeung
ac9c411d18 Add -moz-user-modify 2016-05-17 04:12:18 -04:00
Keith Yeung
5e2f52df23 Add -moz-user-focus 2016-05-17 04:12:17 -04:00
Matt Brubeck
36699c5748 Support vertical-align in geckolib 2016-05-16 11:34:02 -07:00
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
Matt Brubeck
dc6be7bba5 Remove unnecessary clone in LRUCache::touch 2016-05-13 18:20:59 -07: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
Matt Brubeck
65e6938291 Explicitly list inputs to the style crate's build script
This avoids unncessary build script runs caused by changes to unrelated files.
2016-05-11 10:46:33 -07: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
Patrick Walton
04f05349b1 layout: Check flow descendants of inline block fragments to find their
baselines when aligning inline fragments per CSS 2.1 § 10.8.1.
2016-05-04 13:20:21 -07:00
bors-servo
29823cb378 Auto merge of #10934 - emilio:other-gecko-pseudos, r=bholley,mbrubeck
style: Add infrastructure to support lazy pseudo-elements

This builds on top of #10815, so it's really just the last commit the one that should be reviewed.

I tried to apply the new infrastructure to servo, but failed (for now?).

The problem with it is that it'd require `ThreadSafeLayoutElement` to implement `selectors::Element`, which is a lot of work and might be racy (not totally sure about it though). Thus, I prefered to keep selectors eager until knowing that it's safe to do it.

r? @mbrubeck for style changes, @bholley for the geckolib changes (minimal for now, glue + a list of lazy PEs must be added)

<!-- 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/10934)
<!-- Reviewable:end -->
2016-05-04 03:42:23 -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
Emilio Cobos Álvarez
ca41e5359f
docs: Add style overview. 2016-05-04 00:34:03 +02:00
Emilio Cobos Álvarez
a87bf7c776
style: Minor documentation tweaks about lazy pseudo-elements 2016-05-04 00:34:00 +02:00
Emilio Cobos Álvarez
028f9b6cd2
style: layout: Allow a lazy pseudo-element implementation in Servo. 2016-05-04 00:33:58 +02:00
Emilio Cobos Álvarez
9caaa6004e
style: Support lazy pseudo-elements
These can't be supported in Servo as of right now, because I'm not
totally sure the accesses that should be done in layout would be
thread-safe.

It can be revisited later though.
2016-05-03 19:01:54 +02:00
bors-servo
ddada69acb Auto merge of #10957 - heycam:number, r=bholley
Support plain number-typed properties in geckolib

r? @bholley

<!-- 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/10957)
<!-- Reviewable:end -->
2016-05-02 21:58:17 -07: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
3255bb809e Add a predefined Number type. 2016-05-03 10:01:30 +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
Matt Brubeck
a2b0585ffd Update lazy_static, selectors, string_cache, futf, quickersort 2016-05-02 16:05:31 -07:00
Matt Brubeck
1e23d90631 Upgrade to bitflags 0.6.0 and selectors 0.5.6
Types generated by `bitflags!` are now private by default.  This PR marks them
`pub` where necessary.
2016-04-30 10:14:03 -07:00
bors-servo
407f991c8a Auto merge of #10815 - emilio:anonbox-gcs, r=SimonSapin,bholley
style: Support anonymous box pseudo-elements

This is a work-in-progress that:

 * Adds support for some pseudo-elements to skip the cascade entirely, in an analogous way to Gecko's anonymous box pseudo-elements.
 * Takes rid of `StylistWrapper`, and uses `Arc::get_mut` instead.
 * Uses the first bullet to precompute the `-servo-details-content` pseudo's style.

I'd like @bholley to take a look before following, do you think that the aproach is the correct?
Also, @SimonSapin could want to put some eyes on it.

Depends on https://github.com/servo/rust-selectors/pull/81

<!-- 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/10815)
<!-- Reviewable:end -->
2016-04-29 14:27:16 -07:00
Emilio Cobos Álvarez
41f3b1c2ba
style: Remove unneeded lifetime 2016-04-29 22:54:57 +02:00
Emilio Cobos Álvarez
f12e4b826f
style: Add doc-comment about is_eagerly_cascaded_pseudo_element 2016-04-29 22:54:56 +02:00
Emilio Cobos Álvarez
227e39d558
style: Reset the per-pseudo-element maps when update() is called
This was causing panics in stylo.
2016-04-29 22:54:53 +02:00
Emilio Cobos Álvarez
2a499d5a0b
layout: Stop storing PrecomputedStyleData in LayoutNode
Use the SharedStyleContext instead.
2016-04-29 22:54:48 +02:00
Emilio Cobos Álvarez
979c3a54b9
layout: Tidy a bit style pseudo-elements stuff 2016-04-29 22:54:47 +02:00
Emilio Cobos Álvarez
5a43c7e3cd
style: Allow inheritance when computing anonymous box styles
This is used a lot by Gecko, not still for servo though.
2016-04-29 22:54:46 +02:00
Emilio Cobos Álvarez
3563ecb770
style: Use precomputation for the -servo-details-content pseudo-element 2016-04-29 22:54:45 +02:00
Emilio Cobos Álvarez
b6402a81d0
style: Add infrastructure for non-eagerly-cascaded pseudo-elements
This commit also removes StylistWrapper and uses Arc::get_mut instead.
2016-04-29 22:54:45 +02: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
bors-servo
ac8406f4ae Auto merge of #10834 - yoava333:master, r=SimonSapin
added support for :read-only and :read-write pseudo-classes

partial fix for https://github.com/servo/servo/issues/10732

It's not a full fix because:
1. there's a bug in wpt-test https://github.com/w3c/web-platform-tests/issues/2889#issuecomment-214144420
2. we don't fully support all input types (namely image, color, hidden and range), which are defaulted to input text. this means that :read-write which is applicable to input text is mis-handled in those cases.
3. we don't support contenteditable, which is also possibly :read-write

<!-- 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/10834)
<!-- Reviewable:end -->
2016-04-29 08:12:18 -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
bors-servo
e079e01320 Auto merge of #10848 - heycam:struct-accessor, r=bholley
Add Servo_GetStyleFoo functions to get style structs from GeckoComputedValues

r?@bholley

<!-- 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/10848)
<!-- Reviewable:end -->
2016-04-27 02:20:17 -07: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
Akshit Khurana
4a3addb72f Return a Result<i64, ()> from do_parse_integer
Fixes #10860
2016-04-26 23:03:16 -07:00
bors-servo
2729864af7 Auto merge of #10857 - servo:toml, r=nox
Simplify TOML syntax

* Sections like `[dependencies.foo]` can be entries in a `[dependencies]` section with the `{key = value}` syntax.
* Per-target dependencies can be expressed with more general `cfg(…)` conditions instead of exact target triples: https://github.com/rust-lang/cargo/pull/2328

<!-- 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/10857)
<!-- Reviewable:end -->
2016-04-26 15:46:37 -07:00