Commit graph

1181 commits

Author SHA1 Message Date
bors-servo
1e10b67b18 Auto merge of #8485 - hfaulds:make-layout-task-fields-private, r=Ms2ger
Make layout task fields private

For https://github.com/servo/servo/issues/8471

The second commit I'm slightly less sure about but with `chan` made private this warning was shown:

```
components/layout/layout_task.rs:152:5: 152:21 warning: struct field is never used: `chan`, #[warn(dead_code)] on by default
```

There might be some cleanup around `layout_chan` in https://github.com/hfaulds/servo/blob/make-layout-task-fields-private/components/layout/layout_task.rs#L244-L261 as well but that was a bit beyond me.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8485)
<!-- Reviewable:end -->
2015-11-13 02:26:12 +05:30
Hayden Faulds
c0f497d4ac remove unnecessary layout_chan 2015-11-12 13:52:08 +00:00
Hayden Faulds
5e7bf9cd9c remove chan from layout task 2015-11-12 13:15:17 +00:00
Hayden Faulds
66b85fe4fc make layout task fields private 2015-11-12 12:42:57 +00:00
bors-servo
efc31e619d Auto merge of #8376 - mrobinson:fix-inlines, r=pcwalton
Properly make stacking contexts for inlines

Instead of making a stacking context out of inline fragments parent
flow, make the inline fragment itself the stacking context. This fixes
positioning and rendering of these sort of fragments and prevents
over-layerization.

Fixes #7424.
Fixes #5812.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8376)
<!-- Reviewable:end -->
2015-11-12 12:26:39 +05:30
Martin Robinson
d572f1ca05 Properly make stacking contexts for inlines
Instead of making a stacking context out of inline fragments parent
flow, make the inline fragment itself the stacking context. This fixes
positioning and rendering of these sort of fragments and prevents
over-layerization.

Fixes #7424.
Fixes #5812.
2015-11-11 14:42:18 -08:00
Michael Howell
d32a2d6cfc Write reflow results, even with no root node.
Fixes #8240
2015-11-10 15:01:46 -07:00
Bobby Holley
b29369296c Add ::from_layout_js factory to LayoutNode, LayoutElement, and LayoutDocument. 2015-11-10 11:57:25 -08:00
Bobby Holley
7fa7936657 Implement attribute restyle hints.
Fixes #6942.
2015-11-10 11:57:24 -08:00
Bobby Holley
47744d95ad Make RESTYLE_SELF imply RESTYLE_DESCENDANTS.
This is a temporary workaround for #8438.
2015-11-10 11:41:28 -08:00
Ms2ger
1919e19633 Move viewport_size from LayoutTaskData to LayoutTask. 2015-11-09 09:04:05 +01:00
Ms2ger
dd920a06f3 Move epoch from LayoutTaskData to LayoutTask. 2015-11-09 09:04:04 +01:00
Ms2ger
4c3038f378 Pass the constellation_chan to animation::update_animation_state directly. 2015-11-09 09:04:03 +01:00
Ms2ger
c469d09543 Move running_animations from LayoutTaskData to LayoutTask. 2015-11-09 09:04:02 +01:00
Ms2ger
ee2b77e8f5 Move visible_rects from LayoutTaskData to LayoutTask. 2015-11-09 09:04:02 +01:00
Ms2ger
e8f31f2ed7 Move root_flow from LayoutTaskData to LayoutTask. 2015-11-09 09:04:01 +01:00
Ms2ger
53da53ef53 Move outstanding_web_fonts from LayoutTaskData to LayoutTask. 2015-11-09 09:04:00 +01:00
Ms2ger
5e4039d328 Move new_animations_receiver from LayoutTaskData to LayoutTask. 2015-11-09 09:03:59 +01:00
Ms2ger
604d1e8400 Move new_animations_sender from LayoutTaskData to LayoutTask. 2015-11-09 09:03:58 +01:00
Ms2ger
bdfa5fe804 Move generation from LayoutTaskData to LayoutTask. 2015-11-09 09:03:57 +01:00
Ms2ger
880fb9be0b Remove LayoutTaskData::image_cache_task. 2015-11-09 09:03:57 +01:00
Ms2ger
be178c0e5e Remove unused RwData arguments from LayoutTask::exit_now and LayoutTask::prepare_to_exit. 2015-11-09 09:03:56 +01:00
Ms2ger
dcea03c2b4 Move parallel_traversal from LayoutTaskData to LayoutTask. 2015-11-09 09:03:55 +01:00
Ms2ger
49691c1638 Make LayoutTask::solve_constraints_parallel a static method.
This matches LayoutTask::solve_constraints, and will be necessary when we
borrow parallel_traversal directly from the LayoutTask.
2015-11-09 09:03:54 +01:00
Ms2ger
cc1b7acbe6 Make LayoutTask::solve_constraints a static method.
It does not use self.
2015-11-09 09:03:53 +01:00
Ms2ger
8674345d61 Move LayoutTask::first_reflow out of its Cell.
As the LayoutTask is uniquely owned, and we no longer have borrows of its
fields hanging around, we can use mutable references to simplify some code.
2015-11-09 09:03:52 +01:00
Ms2ger
3f4c734cf4 Introduce a RwData struct. 2015-11-09 09:03:52 +01:00
Ms2ger
b8d8505463 Disentangle the message handling from the receiver selection in LayoutTask::handle_request.
This ensures no fields of the LayoutTask are borrowed when calling repaint or
handle_request_helper, which I'll need later.
2015-11-09 09:03:51 +01:00
Ms2ger
ff0acccc06 Consolidate ProfilerMetadata and TimerMetadata.
There is no good reason to have the two types.

This also means that the result of LayoutTask::profiler_metadata no longer
borrows the LayoutTask, which I'll need later.
2015-11-09 09:03:50 +01:00
bors-servo
7ff3a17524 Auto merge of #8039 - tschneidereit:script-owns-stylesheets, r=jdm
Move Stylesheet loading and ownership from the layout task into HTML elements

Stylesheets for `HTMLLinkElement`s are now loaded by the resource task, triggered by the element in question. Stylesheets are owned by the elements they're associated with, which can be `HTMLStyleElement`, `HTMLLinkElement`, and `HTMLMetaElement` (for `<meta name="viewport">).

Additionally, the quirks mode stylesheet (just as the user and user agent stylesheets a couple of commits ago), is implemented as a lazy static, loaded once per process and shared between all documents.

This all has various nice consequences:
 - Stylesheet loading becomes a non-blocking operation.
 - Stylesheets are removed when the element they're associated with is removed from the document.
 - It'll be possible to implement the CSSOM APIs that require direct access to the stylesheets (i.e., ~ all of them).
 - Various subtle correctness issues are fixed.

One piece of interesting follow-up work would be to move parsing of external stylesheets to the resource task, too. Right now, it happens in the link element once loading is complete, so blocks the script task. Moving it to the resource task would probably be fairly straight-forward as it doesn't require access to any external state.

Depends on #7979 because without that loading stylesheets asynchronously breaks lots of content.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8039)
<!-- Reviewable:end -->
2015-11-08 01:11:54 +05:30
Till Schneidereit
543703e3d8 Move Stylesheet loading and ownership from the layout task into HTML elements
Stylesheets for `HTMLLinkElement`s are now loaded by the resource task, triggered by the element in question. Stylesheets are owned by the elements they're associated with, which can be `HTMLStyleElement`, `HTMLLinkElement`, and `HTMLMetaElement` (for `<meta name="viewport">).

Additionally, the quirks mode stylesheet (just as the user and user agent stylesheets a couple of commits ago), is implemented as a lazy static, loaded once per process and shared between all documents.

This all has various nice consequences:
 - Stylesheet loading becomes a non-blocking operation.
 - Stylesheets are removed when the element they're associated with is removed from the document.
 - It'll be possible to implement the CSSOM APIs that require direct access to the stylesheets (i.e., ~ all of them).
 - Various subtle correctness issues are fixed.

One piece of interesting follow-up work would be to move parsing of external stylesheets to the resource task, too. Right now, it happens in the link element once loading is complete, so blocks the script task. Moving it to the resource task would probably be fairly straight-forward as it doesn't require access to any external state.
2015-11-07 18:11:29 +01:00
bors-servo
9a465c5842 Auto merge of #8355 - Ms2ger:Exit, r=nox
Cleanup exit messages and related code.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8355)
<!-- Reviewable:end -->
2015-11-07 22:34:45 +05:30
Till Schneidereit
f1b6c7cc99 Let Stylist compute and store viewport constraints when setting the device 2015-11-07 16:19:13 +01:00
Till Schneidereit
f173504ded Make UA and user stylesheets static and shared by all Stylist instances 2015-11-07 15:45:27 +01:00
Ms2ger
5462afaa8f Remove the unsafe Sync implementation for SharedLayoutContext. 2015-11-07 11:23:50 +01:00
Ms2ger
647232a495 Wrap SharedLayoutContext::stylist in a wrapper to make it Sync. 2015-11-07 11:23:49 +01:00
Ms2ger
e9b77628ce Wrap SharedLayoutContext::canvas_layers_sender in a Mutex. 2015-11-07 11:23:48 +01:00
Ms2ger
8fc75704c9 Wrap SharedLayoutContext::new_animations_sender in a Mutex. 2015-11-07 11:23:47 +01:00
Ms2ger
552a03fde6 Wrap SharedLayoutContext::font_cache_task in a Mutex. 2015-11-07 11:23:44 +01:00
Ms2ger
11e760d582 Remove unused Flow::remove_compositor_layers.
The caller was removed in c72d0c2ed0.
2015-11-07 11:23:43 +01:00
Ms2ger
32bb4044fd Remove unused SharedLayoutContext::constellation_chan. 2015-11-07 11:23:42 +01:00
Ms2ger
bcd541c02c Wrap SharedLayoutContext::image_cache_sender in a Mutex. 2015-11-07 11:23:41 +01:00
Ms2ger
1c11bd09df Remove unused SharedLayoutContext::layout_chan. 2015-11-07 11:23:39 +01:00
bors-servo
65c3185b20 Auto merge of #8341 - bholley:state_hint_selector_ordering, r=pcwalton
Fix restyle hints to handle non-last psuedo-selectors, and track pristine state values rather than changesets

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8341)
<!-- Reviewable:end -->
2015-11-07 09:53:19 +05:30
bors-servo
faf2f34772 Auto merge of #8343 - servo:custom-properties, r=mbrubeck
Fix some custom properties bugs

Fix #7767.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8343)
<!-- Reviewable:end -->
2015-11-07 06:02:36 +05:30
bors-servo
a0221b9126 Auto merge of #8330 - Ms2ger:rm-screen_size, r=larsbergstrom
Remove unused LayoutTaskData::screen_size.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8330)
<!-- Reviewable:end -->
2015-11-07 03:03:44 +05:30
bors-servo
da25b8c848 Auto merge of #8337 - mrobinson:remove-display-list-result, r=pcwalton
Remove DisplayListBuildingResult

Always produce a DisplayList when processing nodes for display list
construction. StackingContexts are now added to the positioned content
section of DisplayLists. This makes the code a bit simpler and opens up
the possibility of producing a StackingContext in another section of
the DisplayList. This doesn't change behavior, but is a cleanup
prerequisite for proper inline stacking context support.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8337)
<!-- Reviewable:end -->
2015-11-06 05:36:35 +05:30
Ms2ger
7d3f7220f7 Remove the unused PipelineExitType field from LayoutControlMsg::ExitNow. 2015-11-05 16:32:47 +01:00
Ms2ger
ad33d920e7 Remove the unused PipelineExitType field from layout_interface::Msg::ExitNow. 2015-11-05 16:17:51 +01:00
Ms2ger
5cd250602f Remove the unused PipelineExitType argument to LayoutTask::exit_now. 2015-11-05 16:09:39 +01:00