Commit graph

71 commits

Author SHA1 Message Date
Manish Goregaokar
603c9439bb
Fix some warnings 2016-09-09 13:27:33 +08:00
UK992
93a103ba73 Reorder use statements 2016-09-09 04:55:19 +02:00
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
de90f5fce8
Add MaybeOwned, and use for ServoNodeData. More docs. 2016-09-02 08:56:49 +05:30
Manish Goregaokar
36c63db5d4
Rename sugar::refptr to sugar::ownership 2016-09-02 08:56:47 +05:30
Manish Goregaokar
8bed07292c
Add bindings for owned types, use for servostyleset 2016-09-02 08:56:45 +05:30
Manish Goregaokar
db7156526f
Allow for regular non-arc borrowed types, use for StyleSet 2016-09-02 08:56:44 +05:30
Manish Goregaokar
9f6b772bbb
Make Arc helpers into methods 2016-09-02 08:56:42 +05:30
Simon Sapin
acc38aa8c2 Use Arc<PropertyDeclarationBlock> everwhere it’s appropriate. 2016-08-31 02:34:07 +02:00
Emilio Cobos Álvarez
4194ba063a
style: Make WorkQueue creation fallible.
Fixes bug 1290205 in bugzilla.
2016-08-25 23:43:31 -07:00
Xidorn Quan
68310780cc Use new name convention for Servo binding functions. 2016-08-23 13:33:52 +10:00
Xidorn Quan
2f4d6b5ce1 Make GeckoDeclarationBlock refcounted. 2016-08-23 09:42:12 +10:00
Manish Goregaokar
2fdbce0743
Resync bindings 2016-08-17 13:19:20 +05:30
Manish Goregaokar
0d4d1b539e Add safer bindings for refcounted types across ffi 2016-08-17 12:30:31 +05:30
Emilio Cobos Álvarez
2b3c684b37
stylo: Add sugar over the bitfield accessors in nsIAtom. 2016-08-15 23:00:16 -07:00
Emilio Cobos Álvarez
010bce128b
stylo: We have an Atom back-end now. 2016-08-15 22:58:33 -07:00
Simon Sapin
f419db834c Replace the SelectorImplExt trait with inherent methods. 2016-08-09 18:17:13 +02: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
Bobby Holley
9b92d0bc3a Make Servo_InheritComputedValues return the default computed values if the passed parent is null.
We could make two separate FFI functions for this, but in practice this is what
the callers are likely to want.
2016-08-03 17:20:21 -07:00
Cameron McCormack
f2a547c7ed Parse style sheets with a real base URL in geckolib. 2016-08-02 16:52:15 +08:00
Bobby Holley
933cef4adc Flush stylesheets when doing non-traversal-driven style operations.
Without this, the stylist can be stale when we query it.
2016-07-28 17:19:08 -07:00
Emilio Cobos Álvarez
96ea1a335c
stylo: don't double check that the root node is dirty in restyle_tree, since now we ensure it in the caller. 2016-07-24 12:51:58 -07:00
bors-servo
1e0321f7dd Auto merge of #12469 - emilio:stylo, r=bholley
style: Rewrite the restyle hints code to allow different kinds of element snapshots.

<!-- 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: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [x] These changes do not require tests because refactoring.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

This is a rewrite for how style interfaces with its consumers in order to allow
different representations for an element snapshot.

This also changes the requirements of an element snapshot, requiring them to
only implement MatchAttr, instead of MatchAttrGeneric. This is important for
stylo since implementing MatchAttrGeneric is way more difficult for us given the
atom limitations. This also allows for more performant implementations in the
Gecko side of things.

I don't want to get this merged just yet, mainly because the stylo part is not
implemented, but I'd like early feedback from @bholley and/or @heycam: How do
you see this approach? I don't think we'll have much problem to implement
MatchAttr for our element snapshots, but... worth checking.

r? @heycam

<!-- 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/12469)
<!-- Reviewable:end -->
2016-07-21 16:54:34 -05:00
Emilio Cobos Álvarez
611e611215
style: Rewrite the restyle hints code to allow different kinds of element snapshots, and use it for Gecko.
This is a rewrite for how style interfaces with its consumers in order to allow
different representations for an element snapshot.

This also changes the requirements of an element snapshot, requiring them to
only implement MatchAttr, instead of MatchAttrGeneric. This is important for
stylo since implementing MatchAttrGeneric is way more difficult for us given the
atom limitations. This also allows for more performant implementations in the
Gecko side of things.
2016-07-21 14:24:04 -07:00
Emilio Cobos Álvarez
0b67b218d0
style: Add a new Timer structure to the shared style context, and basic infrastructure for controlling animations. 2016-07-20 09:05:53 -07:00
Simon Sapin
6d0e48f6cc Remove some type aliases that are now just re-exports. 2016-07-20 08:42:47 +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
db3607471f Move geckolib/properties.mako.rs to style/properties/gecko.mako.rs 2016-07-20 08:40:22 +02:00
Cameron McCormack
64c47ed720 Add FFI glue for Gecko to implement 1-arg CSS.supports() with stylo. 2016-07-19 11:35:34 +08:00
Ms2ger
9f13278b77 Move arc_ptr_eq to style. 2016-07-11 12:13:12 +02:00
Cameron McCormack
0417022ecb Add Servo_StyleWorkerThreadCount. 2016-07-05 18:03:32 -07:00
Cameron McCormack
00fe12d3ad Add STYLO_THREADS environment variable to control number of style worker threads. 2016-07-05 18:03:30 -07:00
Emilio Cobos Álvarez
203d2a62c2
style: Remove the Mutex from new_animations_sender by moving it to the local StyleContext.
As a follow-up, we could move all the data living under a mutex in the
SharedLayoutContext only in order to create the local context to the same place.

This should increase animation performance when there are multiple animations in
one page that happen to be on different threads.
2016-07-01 13:48:06 -07:00
Cameron McCormack
98a32a76df Stop parsing style attributes during restyle in geckolib. 2016-06-24 12:36:39 +10:00
Cameron McCormack
0bf1f2793b Look at nsIAtom.mHash directly rather than call Gecko_HashAtom. 2016-06-18 23:13:44 +10:00
Josh Matthews
3cb8af20c2 Remove empty lines following braces. 2016-05-27 13:32:05 -04:00
Cullen Rhodes
40acd24e8f Report use statements that use {} with only one entry 2016-05-27 10:18:44 +01:00
Cameron McCormack
bbc89a2726 Add Servo_RestyleSubtree. 2016-05-25 12:31:19 +10:00
Cameron McCormack
6d67aa8a01 Pass Gecko sheet base/referrer/principal from Servo_StylesheetFromUTF8Bytes through ParserContext. 2016-05-24 12:12:17 +10:00
Cameron McCormack
bb85f5faf0 Add an extra data field to ParserContext.
This will be used for passing Gecko-specific information through
the CSS parser in stylo.
2016-05-24 12:12:10 +10:00
Bobby Holley
d6a6f2c7e0 Hoist gecko bindings into their own crate.
This will be helpful for leveraging the bindings with our nsIAtom-backed
string_cache replacement.
2016-05-11 14:32:26 -07:00
Bobby Holley
38a6b58a0a Hackily return default computed values for unstyled nodes. 2016-05-06 14:39:59 -07:00
Cameron McCormack
01c42693d4 Add Servo_InheritComputedValues. 2016-05-06 17:23:30 +10: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
d4aa0288d6 Enable standard logging for geckolib. 2016-05-03 17:40:05 -07:00
Bobby Holley
aa0e3e25e2 Add a runtime-wide initialization hook for Geckolib. 2016-05-03 17:40:04 -07:00
Emilio Cobos Álvarez
0f7b70c0b7
geckolib: Implement Servo_GetComputedValuesForPseudoElement 2016-05-04 00:34:10 +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