Commit graph

1300 commits

Author SHA1 Message Date
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
bors-servo
47617578af Auto merge of #9245 - Ms2ger:reexports, r=nox
Stop reexporting style types from layout_interface.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9245)
<!-- Reviewable:end -->
2016-01-11 23:57:51 +05:30
bors-servo
099beee85c Auto merge of #8983 - Manishearth:cursors, r=jdm
Various textinput fixes

 - Currently the cursor sticks around if you click elsewhere. Now the text inputs are relayout-ed on blur.
 - Currently whitespace gets collapsed in text input (https://github.com/servo/servo/issues/8772). Not anymore.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8983)
<!-- Reviewable:end -->
2016-01-11 23:21:03 +05:30
Ms2ger
9dc85e0d40 Stop reexporting ReflowGoal from layout_interface. 2016-01-11 10:00:17 +01:00
Ms2ger
39ba25572b Stop reexporting Animation from layout_interface. 2016-01-11 09:47:08 +01:00
John DeSilva
f32995543d Move Epoch to gfx_traits
Resolves #9222. Moved Epoch from components/msg/compositor_msg to
components/gfx_traits/lib. Updated use statements to reflect the move.
2016-01-10 17:36:52 -05:00
bors-servo
d3889b4be4 Auto merge of #9236 - tgummerer:fix-9220, r=Wafflespeanut
Move LayerType enum to gfx_trait

The LayerType enum is only used in gfx_traits and layout, so it
shouldn't be defined in msg.  Move the definition to gfx_traits
instead.

Fixes #9220

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9236)
<!-- Reviewable:end -->
2016-01-10 21:18:45 +05:30
Thomas Gummerer
70a2179cd2 Move LayerType enum to gfx_trait
The LayerType enum is only used in gfx_traits and layout, so it
shouldn't be defined in msg.  Move the definition to gfx_traits
instead.

Fixes #9220
2016-01-10 16:20:37 +01:00
rohan.prinja
1f02c4ebbb task -> thread 2016-01-10 17:58:13 +09:00
bors-servo
1436ee5afa Auto merge of #9008 - mrobinson:reflow, r=pcwalton
More aggressively remove Fragment RestyleDamage

Now clean up damage on all fragments that belong to a Flow. This ensures
that damage does not re-propagate up to the parent Flow from the
Fragments. It also means that the flow tree dump should show a more
accurate picture of the state of the flow tree.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9008)
<!-- Reviewable:end -->
2016-01-09 07:01:23 +05:30
Martin Robinson
d720452698 Use DisplayListSection everywhere
DisplayListSection, StackingLevel, and BackgroundAndBorderLevel all
represent pretty much the same thing, a particular section of the
display list. Instead of maintaining three enums which do the same
thing, just use DisplayListSection everywhere. It's a superset of the
other two and this change will make it easier to flatten the DisplayList
in the future for WebRender.
2016-01-08 10:19:03 -08:00
bors-servo
58111a6420 Auto merge of #9177 - pcwalton:filter-out-useless-clips, r=glennw
gfx: Eagerly transform clips into `ClippingRegion::max()` if possible.

This helps WebRender look for useless clips and optimize them out.

r? @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9177)
<!-- Reviewable:end -->
2016-01-08 21:24:45 +05:30
bors-servo
a0d26445c0 Auto merge of #9171 - pcwalton:linear-gradients-background-clip, r=mbrubeck
Fix `linear_gradients_lengths_a.html` and fix Servo's use of "background-clip" to actually make it work.

See the commit messages for details.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9171)
<!-- Reviewable:end -->
2016-01-08 15:10:02 +05:30
Bobby Holley
3b33174163 Review nits: Narrowly scoping unsafety, and expanding comment. 2016-01-07 11:17:31 -08:00
Patrick Walton
3103b03262 gfx: Eagerly transform clips into ClippingRegion::max() if possible.
This helps WebRender look for useless clips and optimize them out.
2016-01-06 19:48:14 -08:00
Bobby Holley
29987a6715 Bonus Fix - Rename traverse_dom_preorder to traverse_dom.
The incorrect naming here was bugging me - the dom traversal has both pre- and post-order
processing steps.
2016-01-06 19:21:13 -08:00
Bobby Holley
136c0938a2 Hoist the style parts of sequential.rs into style/. 2016-01-06 19:21:11 -08:00
Bobby Holley
57d2a0b0db Make sequential traversal operate on TNode instead of LayoutNode.
I forgot to do this along with the parallel case. Ideally I'd merge this patch
into that one, but then I'd need to rebase it over the LayoutContext patch,
which would be a pain.
2016-01-06 19:21:09 -08:00
Bobby Holley
60b3c66b28 Hoist the style parts of parallel.rs into style/. 2016-01-06 19:21:07 -08:00
Bobby Holley
f9a02f0aba Hoist the style parts of traversal.rs into style/. 2016-01-06 18:50:16 -08:00
Bobby Holley
bf1a7d243f Remove the dependency of parallel DOM traversal and style calculation on LayoutContext. 2016-01-06 18:24:18 -08:00
Bobby Holley
ebc5eb1b98 Make parallel DOM traversal and style calculation operate on TNode instead of LayoutNode. 2016-01-06 17:58:53 -08:00
Patrick Walton
fdb791bdd5 layout: Take the value of background-clip into account when
determining the painting area for background images and gradients.

See: https://drafts.csswg.org/css-backgrounds-3/#the-background-clip
2016-01-06 10:39:51 -08:00
Bobby Holley
513a75d86a Hoist the rest of css/matching.rs into style/. 2016-01-04 09:41:31 -08:00
Bobby Holley
94b0789a5f Remove the dependency of css/matching.rs on SharedLayoutContext. 2016-01-04 09:38:04 -08:00
Bobby Holley
08f2a24552 Remove the dependency of css/matching.rs on concrete RestyleDamage.
We can make this easier by inlining helper method implementations in the traits themselves,
which makes the code more compact as a nice side-effect.
2016-01-04 09:38:04 -08:00
Bobby Holley
27987c3bb4 Introduce a concept of restyle damage to the style system.
We can't hoist RestyleDamage itself, because it's very layout-dependent. But this
should be enough to let us hoist the things we need.
2016-01-04 09:38:04 -08:00
Bobby Holley
947134949a Refactor parallel dom traversal to be agnostic to the processing steps themselves. 2016-01-04 09:38:04 -08:00
Manish Goregaokar
23e7dfa57b Relayout text input elements on blur 2016-01-03 13:18:24 +05:30
Johannes Linke
6b215f38ee Fix a bunch of clippy lints 2016-01-02 23:27:15 +01:00
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
bors-servo
3f407ea3d6 Auto merge of #9077 - bholley:split_layout_context_etc, r=SimonSapin
Split the style-related bits out of LayoutContext and hoist more stuff into style/

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9077)
<!-- Reviewable:end -->
2015-12-30 11:01:23 +05:30
bors-servo
0f5c614609 Auto merge of #9051 - bholley:split_style_and_layout_wrappers, r=SimonSapin
Split layout wrappers into style+layout and layout-only functionality

This is a step towards removing the dependency of stylo on layout/.

This PR depends on #9004.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9051)
<!-- Reviewable:end -->
2015-12-30 10:04:14 +05:30
Bobby Holley
a05d7f1dfd Hoist style-related context bits into style/.
We do a few things-here:
* Hoist non-layout-dependent fields in SharedLayoutData and LocalLayoutData into style/.
* Hoist parts of css/matching.rs into style/.
* Hoist parts of layout/animation.rs into style/animation.rs.
* Remove the duplicated-but-slightly-different definition of OpaqueNode.
2015-12-29 12:07:07 -08:00
Bobby Holley
47059d2d26 Separate style+layout and layout-specific wrapper functionality.
This patch does a number of things, unfortunately all at once:
* Hoists a large subset of the layout wrapper functionality into the style system.
* Merges TElementAttributes into the newly-created TElement.
* Reorganizes LayoutData by style vs layout, and removes LayoutDataShared.
* Simplifies the API for borrowing style/layout data.

There's still more to do to make the style system usable standalone, but
this is a good start.
2015-12-29 11:50:03 -08:00
Joe Kachmar
655268d111 Separate script and layout messages, issue #8843 2015-12-26 12:24:51 -05:00
bors-servo
f77c792886 Auto merge of #9055 - simartin:issue_9042, r=Wafflespeanut
Issue #9042: Report incorrect number of spaces around => in the style checker

Fixes https://github.com/servo/servo/issues/9042

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9055)
<!-- Reviewable:end -->
2015-12-24 10:55:48 +05:30
Simon Martin
cec661fa86 Issue #9042: Report incorrect number of spaces around => in the style checker. 2015-12-23 20:54:26 +01:00
Bobby Holley
874545d8ca Hoist more stuff from the concrete wrapper implementations into the trait definitions to allow sharing. 2015-12-23 12:05:25 -07:00
Bobby Holley
e55a56d757 Add an is_text_node to LayoutNode, so that we don't need to implement type_id for the style system. 2015-12-23 12:05:25 -07:00
Bobby Holley
6637626e02 Make DangerousThreadSafeLayoutNode public. :-(
I'm open to suggestions on how to do this better.
2015-12-23 12:05:25 -07:00
Martin Robinson
ce8e6fd3b9 More aggressively remove Fragment RestyleDamage
Now clean up damage on all fragments that belong to a Flow. This ensures
that damage does not re-propagate up to the parent Flow from the
Fragments. It also means that the flow tree dump should show a more
accurate picture of the state of the flow tree.
2015-12-23 17:01:22 +01:00
bors-servo
68c4f290c7 Auto merge of #8938 - nerith:gfx, r=Ms2ger
Move LayerKind and ScrollPolicy enums to gfx_traits

Fixes #8836.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8938)
<!-- Reviewable:end -->
2015-12-23 18:38:51 +05:30
bors-servo
48388ad036 Auto merge of #9040 - mrobinson:fix-comment, r=nox
Remove a fixed TODO

Issue #2009 has already been fixed and closed so we can remove this TODO
entirely.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9040)
<!-- Reviewable:end -->
2015-12-22 20:40:13 +05:30
Martin Robinson
ecc58786b7 Remove workaround for Rect::is_empty
Now that euclid is up-to-date this workaround is no longer necessary.
2015-12-22 10:30:52 +01:00
Martin Robinson
74a23c9af2 Remove a fixed TODO
Issue #2009 has already been fixed and closed so we can remove this TODO
entirely.
2015-12-21 18:37:54 +01:00
Brandon Fairchild
637afecec9 Move LayerKind and ScrollPolicy enums to gfx_traits
This also moves LayerId and LayerProperties to gfx_traits.

Fixes #8836.
2015-12-20 20:43:31 -05:00
Mathieu Agopian
11234f5370 Use Url.join instead of UrlParser.base_url(...).parse (#9002) 2015-12-18 17:02:41 +01:00
bors-servo
338f66003e Auto merge of #8995 - pcwalton:measure-text-shaping, r=mbrubeck
gfx: Measure text shaping time in the time profiler.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8995)
<!-- Reviewable:end -->
2015-12-17 10:57:29 +05:30
bors-servo
bc7158310c Auto merge of #8903 - KiChjang:layout-reporter-redirect, r=nox
fix for Layout memory reporter uses pre-redirect url

Rebase of #7612.

Fixes #6872.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8903)
<!-- Reviewable:end -->
2015-12-16 23:18:30 +05:30