Commit graph

268 commits

Author SHA1 Message Date
Olivia Nordquist
aebf87cf5b Un-boxed ScriptReflow 2015-10-31 22:29:16 -07:00
bors-servo
6cc8186481 Auto merge of #8187 - Ms2ger:layoutnode-new, r=pcwalton
Introduce a Layoutnode::new function and use it.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8187)
<!-- Reviewable:end -->
2015-10-30 13:43:17 +05:30
bors-servo
b6bcccb204 Auto merge of #8212 - Ms2ger:reflow-root, r=pcwalton
Remove SharedLayoutContext::reflow_root.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8212)
<!-- Reviewable:end -->
2015-10-30 05:22:54 +05:30
Ms2ger
cce510900e Use LayoutNode::new to avoid transmute calls in LayoutTask. 2015-10-29 16:55:27 +01:00
Ms2ger
ee0b0c81d1 Pass a LayoutNode to LayoutTask::dirty_all_nodes.
There is no point in passing a mutable reference to what is essentially
already a pointer.
2015-10-29 14:29:17 +01:00
Bobby Holley
069c40f788 Check modified event state from layout and dirty it there.
This adds some overhead, but also provides the small performance benefit of
avoiding dirtying in the case where an event state is toggled an even
number of times between reflows.

The main benefit here though is that it sets us up to be smarter about
what we mark as dirty using restyle hints.
2015-10-27 12:48:48 -07:00
Bobby Holley
441c84d75d Pass the document instead of the documentElement to reflow. 2015-10-27 12:41:16 -07:00
Bobby Holley
85596b5510 Use an RAII guard to join the script task. 2015-10-27 12:41:14 -07:00
Ms2ger
c693e13a2c Remove the reflow root from SharedLayoutContext. 2015-10-26 17:51:28 +01:00
Ms2ger
68830ed66f Return the result from process_content_box_request. 2015-10-26 10:41:51 +01:00
Ms2ger
60e60b6f8a Return the result from process_content_boxes_request. 2015-10-26 10:41:50 +01:00
Ms2ger
a84055d8fe Return the result from process_node_geometry_request. 2015-10-26 10:41:50 +01:00
Ms2ger
9754bfc330 Return the result from process_resolved_style_request. 2015-10-26 10:41:49 +01:00
Ms2ger
16b6e812a2 Return the result from process_offset_parent_query. 2015-10-26 10:41:48 +01:00
Ms2ger
4cac3f4f97 Remove a pointless clone() from add_font_face_rules. 2015-10-25 22:46:34 +01:00
Ms2ger
c86141c55a Remove an unnecessary Atom::clone() call. 2015-10-25 11:08:15 +01:00
bors-servo
4d737b51bb Auto merge of #8155 - Ms2ger:join, r=jdm
Remove Window::layout_join_port.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8155)
<!-- Reviewable:end -->
2015-10-23 04:50:38 -06:00
Ms2ger
9ad69586d1 Remove the ConstellationControlMsg::ReflowComplete message. 2015-10-22 16:12:58 +02:00
Ms2ger
28c738455e Use the select!{} macro in LayoutTask::handle_request. 2015-10-22 14:18:22 +02:00
Bobby Holley
228eff7272 Remove HAS_DIRTY_SIBLINGS.
This isn't doing anything right now, and we're not even setting it properly
in dirty_impl the |dirty_subtree(self)| was causing us to hit the skip case
for step 3.
2015-10-21 09:56:07 -07:00
Corey Farwell
20beaf5af3 Fix issues found by rust-clippy 2015-10-12 20:21:49 -04:00
bors-servo
098bdb5f22 Auto merge of #7807 - glennw:pid, r=jdm
Make it possible for iframes to create their own pipeline ID.

This doesn't change any functionality, but it's the first step towards removing SubpageId.

Adding this change now will allow us to gradually change over code referencing subpage id rather than in one massive PR.

Introduces a namespace for pipeline ID generation - there is a namespace for the constellation thread, and one per script thread.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7807)
<!-- Reviewable:end -->
2015-10-06 01:08:32 -06:00
Glenn Watson
5645dba1fa Make it possible for iframes to create their own pipeline ID.
This doesn't change any functionality, but it's the first step towards removing SubpageId.

Adding this change now will allow us to gradually change over code referencing subpage id rather than in one massive PR.

Introduces a namespace for pipeline ID generation - there is a namespace for the constellation thread, and one per script thread.
2015-10-06 17:06:53 +10:00
Martin Robinson
553f1fc192 Rework how StackingContexts are dynamically added to layers
StackingContexts are added to layers when it is necessary to maintain
their ordering on top of other layered StackingContexts. Instead of
tracking the information about a layer scattered around into different
structs, combine it all into LayerInfo. LayerInfo will be used in the
future to hold layer information for DisplayItems that are layerized
independently of StackingContexts.
2015-10-05 13:35:31 -07:00
James Gilbertson
d0ace58452 Handle <meta name=viewport> elements when added to document 2015-09-30 20:31:35 -07:00
Glenn Watson
339a3f869b Split Au type into separate crate, with minimal dependencies. 2015-10-01 07:16:11 +10:00
Patrick Walton
c72d0c2ed0 layout: Make the compositor rather than layout determine the position of
each iframe.

The old code that attempted to do this during layout wasn't able to work
for multiple reasons: it couldn't know where the iframe was going to be
on the page (because of nested iframes), and at the time it was building
the display list for a fragment it couldn't know where that fragment was
going to be in page coordinates.

This patch rewrites that code so that both the sizes and positions of
iframes are determined by the compositor. Layout layerizes all iframes
and marks the iframe layers with the appropriate pipeline and subpage
IDs so that the compositor can place them correctly. This approach is
similar in spirit to Gecko's `RefLayer` infrastructure. The logic that
determines when it is time to take the screenshot for reftests has been
significantly revamped to deal with this change in delegation of
responsibility.

Additionally, this code removes the infrastructure that sends layout
data back to the layout task to be destroyed, since it is now all
thread-safe and can be destroyed on the script task.

The failing tests now fail because of a pre-existing bug related to
intrinsic heights and borders on inline replaced elements. They happened
to pass before because we never rendered the iframes at all, which meant
they never had a chance to draw the red border the tests expect to not
render!

Closes #7377.
2015-09-29 09:47:28 -07:00
Patrick Walton
9bb6acd690 layout: Load Web fonts asynchronously.
Improves page load times significantly.

Closes #7343.
2015-09-27 15:38:20 -07:00
Eli Friedman
f0da2a3701 Delete dead code.
(#[cfg(debug)] is false in every normal servo configuration, and the
code in question doesn't compile.)
2015-09-26 00:23:03 -07:00
bors-servo
b4b3cedc10 Auto merge of #7724 - glennw:expire-anims, r=pcwalton
Ensure that animations expire correctly and stop compositing occurring after they finish.

There were two problems here:

(1) The animation state update function was only called when nodes were dirty or there were new animations.
(2) When all animations for a node expired, the entry from the hash table was not removed.

The result was that once an animation began, the compositor would be running as fast as it can forever.

Fixes #7721.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7724)
<!-- Reviewable:end -->
2015-09-23 18:46:29 -06:00
Glenn Watson
f6cb6c3b86 Ensure that animations expire correctly and stop compositing occurring after they finish.
There were two problems here:
(1) The animation state update function was only called when nodes were dirty or there were new animations.
(2) When all animations for a node expired, the entry from the hash table was not removed.

The result was that once an animation began, the compositor would be running as fast as it can forever.

Fixes #7721.
2015-09-24 10:29:58 +10:00
Ravi Shankar
889eec364b sorted the extern crate, mod & use declarations 2015-09-24 02:12:45 +05:30
Brandon Fairchild
de3547e401 Fix reported test-tidy errors for unmerged import blocks
This merges import blocks that were reported by tidy as unmerged.
2015-09-19 12:50:14 -04:00
Martin Robinson
1e6f797268 Ensure unique LayerIds for pseudo-elements
Currently pseudo-elements, like the fragments created for ::before and
::after, with layers will have the same LayerId as the body of their
owning fragments. Instead all LayerIds should be unique.

Fixes #2010.
2015-09-17 06:42:29 -07:00
Simon Sapin
feaf6f4c3f Initial support for custom properties in CSSStyleDeclaration 2015-09-17 14:48:56 +02:00
Patrick Walton
757e2cf4e5 layout: Reformat some long lines and fix some whitespace issues. 2015-09-17 13:31:17 +02:00
Martin Robinson
30963d76be Improve printing of DisplayLists
Use box tree characters to make DisplayLists easier to scan when
printing them out.
2015-09-16 12:31:38 -07:00
Patrick Walton
99587cf105 layout: Allow the overflow area of the <body> to be scrolled.
Fixes scrolling on Twitter.
2015-09-10 18:07:21 -07:00
Glenn Watson
a02d28a732 Handle cases where the layout root is None. Fixes #6375. 2015-09-08 11:19:58 +10:00
bors-servo
8e0b010117 Auto merge of #7487 - mrobinson:paint-layer-upgrade, r=pcwalton
Have PaintLayers own StackingContexts instead of the opposite

Previously, StackingContexts might have a PaintLayer. We switch the
ownership, for several reasons:

   * We want PaintLayers to potentially contain something other
     than a StackingContext soon.
   * We want to delay the creation of PaintLayers until the last
     minute, so that we can synthesize new layers for sandwiched
     content.

This commit also implements the second goal. Instead of creating
PaintLayers during layout itself, wait until we are sorting and
layerizing a completed DisplayList.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7487)
<!-- Reviewable:end -->
2015-09-04 17:31:54 -06:00
Martin Robinson
4ca93c39d6 Have PaintLayers own StackingContexts instead of the opposite
Previously, StackingContexts might have a PaintLayer. We switch the
ownership, for several reasons:

   * We want PaintLayers to potentially contain something other
     than a StackingContext soon.
   * We want to delay the creation of PaintLayers until the last
     minute, so that we can synthesize new layers for sandwiched
     content.

This commit also implements the second goal. Instead of creating
PaintLayers during layout itself, wait until we are sorting and
layerizing a completed DisplayList.
2015-09-04 15:07:09 -07:00
Manish Goregaokar
54c036cd66 Elide most 'a lifetimes 2015-09-04 08:55:51 +05:30
Simon Sapin
21d69314d4 Don’t mark flow_ref::deref_mut as unsafe.
See discussion in https://github.com/servo/servo/pull/7237
2015-08-21 21:16:25 +02:00
Simon Sapin
2d22aa8e7e Replace the unsound impl DerefMut for FlowRef with an unsafe function.
See #6503.
2015-08-20 16:24:26 +02:00
Johann Tuffe
ec07178b6f sort all uses 2015-08-20 20:47:12 +08:00
Patrick Walton
a516042edb layout: Don't panic if requestAnimationFrame() is called before first layout.
Closes #7115.
2015-08-20 13:17:07 +02:00
Corey Farwell
6aaada64dc flow::Flow should follow *_mut naming conventions
Fixes #7148
2015-08-18 09:12:01 -04:00
Josh Matthews
8bb853f643 Fix existing syntactics nits. 2015-08-16 10:30:43 -04:00
João Oliveira
0038580abf Replace uses of for foo in bar.iter() and for foo in bar.iter_mut()
closes #7197
2015-08-15 02:27:39 +01:00
Ms2ger
fdafc5c360 Store a Sender<ConstellationControlMsg> in LayoutTask. 2015-08-12 15:55:16 +02:00