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
Bobby Holley
1d8d1cb9d9
Upgrade rust-selectors.
2016-07-05 18:03:40 -07:00
Anthony Ramine
a5b524d559
Move util::vec::ForgetfulSink to style::sink and simplify it
2016-07-04 16:48:14 +02:00
Emilio Cobos Álvarez
392f243ca7
style: Shadow declarations of no-op animations
...
Although we don't generate a "computed" keyframe animation, we're required to
shadow others.
2016-06-28 15:28:01 +00:00
Emilio Cobos Álvarez
9cf2e52d36
tidy: Clean up warnings and tidy lints.
2016-06-28 15:09:53 +00:00
Emilio Cobos Álvarez
5b27e46d04
style: Atomize animation names.
2016-06-28 15:09:53 +00:00
Emilio Cobos Álvarez
058bfb39ae
style: Refactor the @keyframes parsing and add adequate computation for it.
2016-06-28 15:09:53 +00:00
Emilio Cobos Álvarez
6a362ae8e8
style: Refactor all the animated properties to use the style system properly
2016-06-28 15:09:53 +00:00
Emilio Cobos Álvarez
60192bb830
style: Refactor to pass animations cleanly, land animation-name parsing as experimental
2016-06-28 15:09:53 +00:00
Emilio Cobos Álvarez
c1fd7432e9
style: Add @keyframe rule parsing.
2016-06-28 15:09:53 +00:00
Ms2ger
79e0d18a1d
Add some documentation to the style crate.
2016-06-27 17:33:14 +02:00
Simon Sapin
00b6210519
Make the style crate almost build on stable Rust.
...
`discriminant_value` will need to be replaced with something else later.
2016-06-22 15:44:13 +02:00
Ms2ger
1c65ce8f36
Deny unsafe code in some more modules.
2016-06-04 18:07:16 +02:00
Josh Matthews
3cb8af20c2
Remove empty lines following braces.
2016-05-27 13:32:05 -04: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
Per Lundberg
2f7ed1d73e
Removed unused imports
...
This fixes #11185 .
2016-05-15 22:24:26 +03: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
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
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
Simon Sapin
374679852c
Make chrome: URLs have a "host".
2016-04-23 20:28:02 +02:00
Corey Farwell
c37ab1facd
Make read_resource_file
param simpler and more idiomatic.
...
`<P: AsRef<Path>>` is also what `File::open` uses as a generic type for
the parameter.
2016-04-16 23:06:59 -04:00
Simon Sapin
6889f37d9e
Remove the url! plugin.
...
In rust-url 1.0 the `Url` struct is going to have private fields, and there
is no way to to create an aribitrary one without going through the parser.
The plugin never had a clear demonstrated performance benefit,
it was made mostly because it was possible and relatively easy at the time.
2016-04-14 15:35:28 +02:00
Emilio Cobos Álvarez
41708d753e
style: Improve style::selector_matching documentation
2016-04-02 16:43:41 +02:00
Michael Howell
0a82d68f3e
Use the new device viewport size for constaints.
...
Fixes #8443
2016-03-29 09:11:12 -07:00
Emilio Cobos Álvarez
5ed93a5c4a
Change old references of ecoal95
2016-03-23 18:12:40 +01:00
bors-servo
41060dbdd7
Auto merge of #10105 - mbrubeck:dirty-viewport-percentages, r=SimonSapin
...
Don't re-add stylesheets to recompute vw/vh lengths
This is a follow-up to #9876 . It avoids clearing and rebuilding SelectorMaps
when vh and vw units need to be recomputed. Instead it just dirties all nodes,
to force elements to be re-cascaded.
Filed #10104 for later follow-up work to dirty only affected nodes.
r? @SimonSapin
<!-- 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/10105 )
<!-- Reviewable:end -->
2016-03-22 18:58:47 +05:30
bors-servo
9a8ba23a76
Auto merge of #10088 - pkondzior:7038-report-memory-usage-in-layout-thread-data-stylist, r=ecoal95
...
Report memory usage from LayoutThreadData Stylist [#7038 ]
@jdm PTAL I'm not sure what is the approach of updating cargo components here, I've made a pull request https://github.com/servo/heapsize/pull/54 but it has to be landed first before merge and version bump.
<!-- 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/10088 )
<!-- Reviewable:end -->
2016-03-22 06:54:11 +05:30
Matt Brubeck
37636e8377
Don't re-add stylesheets to recompute vw/vh lengths
...
This is a follow-up to #9876 . It avoids clearing and rebuilding SelectorMaps
when vh and vw units need to be recomputed. Instead it just dirties all nodes,
to force elements to be re-cascaded.
Filed #10104 for later follow-up work to dirty only affected nodes.
2016-03-21 10:05:17 -07:00
bors-servo
090da52913
Auto merge of #9586 - notriddle:details_ui, r=SimonSapin
...
Details ui
Requires a patch to rust-selectors, and doesn't currently recalculate the styles correctly (which is needed to make actual toggling work correctly).
Still trying to figure out what it takes to get style recalc to do what this needs.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg " height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9586 )
<!-- Reviewable:end -->
2016-03-20 13:27:59 +05:30
Michael Howell
9d9c5398a8
Get the fundamentals of the HTMLDetailsElement rendering stuff working.
...
Still need to implement the style invalidation.
Part of #9395
2016-03-19 16:02:11 -07:00
Matt Brubeck
25c1bce9f6
Recompute viewport-dependent styles on viewport size change
...
Fixes #8754 .
2016-03-19 13:23:39 -07:00
Pawel Kondzior
db2e10a70f
Report memory usage from LayoutThreadData Stylist [ #7038 ]
2016-03-19 11:53:13 -07:00
Bobby Holley
b1878bd925
Remove lifetimes from T{Node,Element,Document}.
2016-03-14 14:31:57 -07:00
Bobby Holley
4da1171474
Stop using servo UA stylesheets for geckolib.
...
Gecko will provide these. This also removes the need to reference
the servo resource directory.
2016-03-04 11:46:32 -08:00
Emilio Cobos Álvarez
a604d605ed
style: Prevent a crash when push_applicable_declarations is called with a non eagerly-cascaded pseudo-element
...
This actually didn't happen, but this should be done sooner than later.
2016-02-13 16:05:16 +01:00
Emilio Cobos Álvarez
eddec5cc06
style: Use fnv hashing for pseudo-elements
2016-02-13 16:05:14 +01:00
Emilio Cobos Álvarez
dd503dfacb
Refactor style to be completely backend-independent
...
This commit refactors the style crate to be completely independent of
the actual implementation and pseudo-elements supported.
This also adds a gecko backend which introduces parsing for the
anonymous box pseudo-elements[1], although there's still no way of
querying them.
https://mxr.mozilla.org/mozilla-central/source/layout/style/nsCSSAnonBoxList.h
2016-02-13 16:05:14 +01:00
Emilio Cobos Álvarez
a1c830f1c1
Update rust-selectors
...
This commits updates rust-selectors to use the generic parser, and as
such it moves the element state into the style crate.
2016-02-03 02:11:31 +01:00
Bobby Holley
384cdfcfff
Hoist ParseErrorReporter into style and remove the dependency on msg.
...
The pipeline id stuff is currently unused. If someone needs it, they can add
an additional trait bound on their css error reporter to get the pipeline id.
2016-01-11 18:01:48 -08:00
Johannes Linke
6b215f38ee
Fix a bunch of clippy lints
2016-01-02 23:27:15 +01:00
bors-servo
3791447de8
Auto merge of #9090 - Ms2ger:stylesheets-vec, r=SimonSapin
...
Don't copy the list of stylesheets in LayoutTask::handle_reflow.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9090 )
<!-- Reviewable:end -->
2015-12-31 21:50:22 +05:30
Ms2ger
828392b41c
Don't copy the list of stylesheets in LayoutTask::handle_reflow.
...
It would be nice to avoid exposing the fact that these are stored in an Arc
to the selector matching code.
2015-12-30 15:13:08 +01:00
Ms2ger
2fa45aa064
Deny unsafe code in style.
2015-12-30 14:46:35 +01:00