Commit graph

252 commits

Author SHA1 Message Date
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
Ms2ger
4f9ec8915d Store a Sender<ConstellationControlMsg> in ScriptReflow. 2015-08-12 15:47:35 +02:00
Patrick Walton
df4acbac04 layout: Implement basic overflow: scroll functionality.
Known issues:

* Display list optimization can sometimes optimize out elements that
  should be shown. This affects the Enyo demo.

* The `overflow: scroll` container doesn't clip the inner layer properly
  when borders, border radius, etc. are present.

* `overflow-x: scroll` and `overflow-y: scroll` don't work individually;
  elements are scrolled all at once.

* Scrolling only works on absolutely-positioned elements.
2015-08-10 21:27:04 -07:00
Patrick Walton
11822f3eb1 layout: Remove the now-useless dirty field from the layout context.
At this point the only thing it does is to try to avoid adding display
items that are outside the root scrollable area, which is both wrong
(since it's incompatible with having scrollable areas outside the root)
and is useless (because we have displayports now).
2015-08-10 21:27:03 -07:00
Patrick Walton
6b32e5d7a7 servo: Update ipc-channel to pick up bincode support.
Large improvement in page load times, especially in debug builds.
2015-08-08 09:43:53 -07:00
Simon Sapin
4833204653 Support @font-face in user and user agent stylesheets. 2015-08-07 21:08:53 +02:00
Ms2ger
bf3ecaa901 Create a run_with_memory_reporting method to reduce the boilerplate associated with registering memory reporters. 2015-08-06 15:24:27 +02:00
bors-servo
172f046688 Auto merge of #6836 - nick-thompson:layout_refactor, r=Ms2ger
Extract layout query code into layout/query.rs

Fix for #6787. I left the commits split up for ease of review, happy to squash when this gets accepted.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6836)
<!-- Reviewable:end -->
2015-08-06 03:29:16 -06:00
Nick Thompson
f114304a3a Extract layout query code into query.rs 2015-08-05 10:24:00 -07:00
Glenn Watson
aca98b2901 No need for paint layer in stacking context to be an arc. 2015-08-05 14:35:49 +10:00
Glenn Watson
9e5687e3e7 Implement offsetParent/Top/Left/Width/Height. 2015-08-03 11:55:38 +10:00
Patrick Walton
7349b6ac28 layout: Tie transitions to the DOM node and finish them instantly when
new styles are set.

Tying transitions to the DOM node avoids quadratic complexity when
updating them.

Finishing transitions instantly when styles are updated makes our
behavior more correct.
2015-08-01 23:01:43 -07:00
Patrick Walton
1ff7a51f0a compositing: Use an OptionalIpcSender for communication between the
layout and paint tasks.
2015-07-31 08:42:30 -07:00
Patrick Walton
3be5bbbaa3 gfx: Split the paint messages into layout and chrome messages, and make
the layout messages serializable.
2015-07-31 08:42:29 -07:00
bors-servo
bff5e325a8 Auto merge of #6802 - nnethercote:report-kind, r=jdm
Add a `kind` field to memory reports.

This is used for two memory reporting improvements.

- It's used to distinguish "explicit" memory reports from others. This
  mirrors the same categorization that is used in Firefox, and gives a single
  tree that's the best place to look. It replaces the "pages" tree which
  was always intended to be a temporary stand-in for "explicit".

- It's used to computed "heap-unclassified" values for both the jemalloc
  and system heaps, both of which are placed into the "explicit" tree.

Example output:
```
|  114.99 MiB -- explicit
|      52.34 MiB -- jemalloc-heap-unclassified
|      46.14 MiB -- system-heap-unclassified
|      14.95 MiB -- url(file:///home/njn/moz/servo2/../servo-static-suite/wikipe
dia/Guardians%20of%20the%20Galaxy%20(film)%20-%20Wikipedia,%20the%20free%20encyc
lopedia.html)
|          7.32 MiB -- js
|             3.07 MiB -- malloc-heap
|             3.00 MiB -- gc-heap
|                2.49 MiB -- used
|                0.34 MiB -- decommitted
|                0.09 MiB -- unused
|                0.09 MiB -- admin
|             1.25 MiB -- non-heap
|          1.36 MiB -- layout-worker-3-local-context
|          1.34 MiB -- layout-worker-0-local-context
|          1.24 MiB -- layout-worker-1-local-context
|          1.24 MiB -- layout-worker-4-local-context
|          1.16 MiB -- layout-worker-2-local-context
|          0.89 MiB -- layout-worker-5-local-context
|          0.38 MiB -- layout-task
|             0.31 MiB -- display-list
|             0.07 MiB -- local-context
|       1.56 MiB -- compositor-task
|          0.78 MiB -- surface-map
|          0.78 MiB -- layer-tree
```
The heap-unclassified values dominate the "explicit" tree because reporter
coverage is still quite poor.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6802)
<!-- Reviewable:end -->
2015-07-29 19:42:00 -06:00
David Zbarsky
e484d6b5e3 Implement getComputedStyle 2015-07-29 20:17:50 -04:00
Nicholas Nethercote
187068e2ae Add a kind field to memory reports.
This is used for two memory reporting improvements.

- It's used to distinguish "explicit" memory reports from others. This
  mirrors the same categorization that is used in Firefox, and gives a single
  tree that's the best place to look. It replaces the "pages" tree which
  was always intended to be a temporary stand-in for "explicit".

- It's used to computed "heap-unclassified" values for both the jemalloc
  and system heaps, both of which are placed into the "explicit" tree.

Example output:
```
|  114.99 MiB -- explicit
|      52.34 MiB -- jemalloc-heap-unclassified
|      46.14 MiB -- system-heap-unclassified
|      14.95 MiB -- url(file:///home/njn/moz/servo2/../servo-static-suite/wikipe
dia/Guardians%20of%20the%20Galaxy%20(film)%20-%20Wikipedia,%20the%20free%20encyc
lopedia.html)
|          7.32 MiB -- js
|             3.07 MiB -- malloc-heap
|             3.00 MiB -- gc-heap
|                2.49 MiB -- used
|                0.34 MiB -- decommitted
|                0.09 MiB -- unused
|                0.09 MiB -- admin
|             1.25 MiB -- non-heap
|          1.36 MiB -- layout-worker-3-local-context
|          1.34 MiB -- layout-worker-0-local-context
|          1.24 MiB -- layout-worker-1-local-context
|          1.24 MiB -- layout-worker-4-local-context
|          1.16 MiB -- layout-worker-2-local-context
|          0.89 MiB -- layout-worker-5-local-context
|          0.38 MiB -- layout-task
|             0.31 MiB -- display-list
|             0.07 MiB -- local-context
|       1.56 MiB -- compositor-task
|          0.78 MiB -- surface-map
|          0.78 MiB -- layer-tree
```
The heap-unclassified values dominate the "explicit" tree because reporter
coverage is still quite poor.
2015-07-29 16:11:19 -07:00