Commit graph

862 commits

Author SHA1 Message Date
Simon Sapin
4833204653 Support @font-face in user and user agent stylesheets. 2015-08-07 21:08:53 +02:00
Matt Brubeck
4e8d2b0e38 Allow list markers to contain multiple fragments
Fixes #6913.
2015-08-07 07:33:06 -07:00
Patrick Walton
ed4172b2c6 layout: Make sure anonymous table flows are statically positioned.
The failing `float-applies-to-*` CSS 2.1 tests never really should have
been passing in the first place; they depend on floats inside
fixed-layout tables working properly, which they don't.

Closes #6078.
Closes #6709.
Closes #6858.
2015-08-06 18:49:07 -07:00
bors-servo
da06c2dda0 Auto merge of #7011 - pcwalton:inline-margin-intrinsic-size, r=mbrubeck
layout: Take inline margins into account when determining the intrinsic sizes of fragments.

Avoids a needless wrapped line in the repository name on GitHub.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7011)
<!-- Reviewable:end -->
2015-08-06 18:28:13 -06:00
bors-servo
76b4bae6ee Auto merge of #7054 - Manishearth:rollup, r=Manishearth
Rollup of 3 pull requests

- Successful merges: #7028, #7034, #7039
- Failed merges:

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7054)
<!-- Reviewable:end -->
2015-08-06 17:43:09 -06:00
Manish Goregaokar
730ee4d341 Rollup merge of #7034 - Ms2ger:mem, r=jdm
Create a run_with_memory_reporting method to reduce the boilerplate a…

…ssociated with registering memory reporters.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7034)
<!-- Reviewable:end -->
2015-08-07 03:45:29 +05:30
Matt Brubeck
b5f9c06776 Rollup merge of #7015 - mbrubeck:arc-box, r=Ms2ger
Replace Arc<Box<TextRun>> with Arc<TextRun>

Removes an extraneous level of indirection.

r? @pcwalton

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7015)
<!-- Reviewable:end -->
2015-08-06 14:07:32 -07:00
Matt Brubeck
26087aab38 Rollup merge of #7014 - mbrubeck:box-string, r=pcwalton
Use Box<str> instead of Box<String> for UnscannedTextFragmentInfo

This removes an extraneous layer of indirection, without increasing the size of the `SpecificFragmentInfo` enum (because `Box<str>` is a fat pointer, which is the same size as the `FlowRef` trait object that is already stored in `InlineAbsoluteHypotheticalFragmentInfo`)

r? @pcwalton

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7014)
<!-- Reviewable:end -->
2015-08-06 14:07:31 -07:00
bors-servo
cf4b411832 Auto merge of #7008 - pcwalton:floated-negative-margins, r=mbrubeck
layout: Take negative margins of floats into account when placing them.

Removes extraneous inline space on GitHub pull requests.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7008)
<!-- Reviewable:end -->
2015-08-06 11:55:58 -06: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
bors-servo
be8798b73a Auto merge of #6994 - servo:warnings, r=Manishearth
Fix unused mutability warnings.

They were introduced in 35ba731123.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6994)
<!-- Reviewable:end -->
2015-08-05 22:02:45 -06:00
Jack Moffitt
f570da28c2 Merge pull request #6988 from glennw/no-arc
No need for paint layer in stacking context to be an arc.
2015-08-05 20:06:09 -06:00
Matt Brubeck
8a09f738d4 Replace Arc<Box<TextRun>> with Arc<TextRun> 2015-08-05 18:28:20 -07:00
Matt Brubeck
c4dde7297e Use Box<str> instead of Box<String> for UnscannedTextFragmentInfo
This removes an extraneous layer of indirection, without increasing the size
of the `SpecificFragmentInfo` enum (because `Box<str>` is a fat pointer, which
is the same size as the `FlowRef` trait object that is already stored in
`InlineAbsoluteHypotheticalFragmentInfo`)
2015-08-05 18:05:05 -07:00
Patrick Walton
fba0a8164d layout: Take inline margins into account when determining the intrinsic
sizes of fragments.

Avoids a needless wrapped line in the repository name on GitHub.
2015-08-05 12:29:16 -07:00
Patrick Walton
95c9d3cefe layout: Take negative margins of floats into account when placing them.
Removes extraneous inline space on GitHub pull requests.
2015-08-05 11:15:32 -07:00
Nick Thompson
f114304a3a Extract layout query code into query.rs 2015-08-05 10:24:00 -07:00
Ms2ger
a7ca54a325 Fix unused mutability warnings.
They were introduced in 35ba731123.
2015-08-05 15:45:05 +02:00
bors-servo
cc70e2f91f Auto merge of #6980 - pcwalton:inline-border-baseline, r=glennw
layout: Take borders into account when positioning inline fragments on their baselines.

Improves the Rust GitHub page.

r? @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6980)
<!-- Reviewable:end -->
2015-08-05 05:03:43 -06:00
bors-servo
56a9eab2a0 Auto merge of #6976 - pcwalton:vertical-marker-placement, r=mbrubeck
layout: Place list item markers correctly in the block direction.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6976)
<!-- Reviewable:end -->
2015-08-05 00:57:19 -06:00
Glenn Watson
aca98b2901 No need for paint layer in stacking context to be an arc. 2015-08-05 14:35:49 +10:00
bors-servo
b9f00190e1 Auto merge of #6979 - mbrubeck:counter, r=pcwalton
Fix crash caused by negative numbers in list counters.

Fixes #6818.  The test still fails because of #6978.

r? @pcwalton

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6979)
<!-- Reviewable:end -->
2015-08-04 18:37:10 -06:00
Patrick Walton
2880aa2b02 layout: Take borders into account when positioning inline fragments on
their baselines.

Improves the Rust GitHub page.
2015-08-04 16:20:15 -07:00
Matt Brubeck
35ba731123 Fix handling of negative numbers in list counters.
Fixes #6818.
2015-08-04 16:18:09 -07:00
Patrick Walton
a746fa0ac1 layout: Place list item markers correctly in the block direction. 2015-08-04 14:44:54 -07:00
bors-servo
56d3426431 Auto merge of #6940 - pcwalton:inline-pseudo-repair-jumpiness, r=mbrubeck
layout: When repairing styles for incremental reflow, only repair styles of nodes that represent the dirty node, *including its pseudo-element*.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6940)
<!-- Reviewable:end -->
2015-08-04 12:53:26 -06:00
Patrick Walton
04928bf1e3 layout: Don't use the block container inline size as the initial
computed table inline size.

Makes google.com fully centered.
2015-08-04 09:40:35 -07:00
Patrick Walton
0a589d413d layout: When repairing styles for incremental reflow, only repair
styles of nodes that represent the dirty node, *including its
pseudo-element*.

Fixes lots more jumpiness.

A manual test, `inline-pseudo-repair-jumpiness.html`, has been added. I
was unable to automate it, so I will file a followup issue on that.
2015-08-04 09:02:41 -07:00
bors-servo
672b38e83a Auto merge of #6946 - pcwalton:block-formatting-context-margins, r=mbrubeck
layout: If the container of a block formatting context has margins in the inline direction, subtract those from the inline size of preceding floats.

Makes the content area on http://reddit.com/r/rust visible.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6946)
<!-- Reviewable:end -->
2015-08-04 02:41:40 -06:00
bors-servo
94cd76df61 Auto merge of #6938 - pcwalton:inline-repair-jumpiness, r=mbrubeck
construct: When repairing styles for incremental reflow, only repair styles of nodes that represent the dirty node.

Fixes jumpiness on many pages; e.g. the WPT results pages.

For some reason, this would not reproduce with an automated test.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6938)
<!-- Reviewable:end -->
2015-08-03 23:37:47 -06:00
Patrick Walton
3d9cc784d0 layout: If the container of a block formatting context has margins in
the inline direction, subtract those from the inline size of preceding
floats.

Makes the content area on http://reddit.com/r/rust visible.
2015-08-03 19:22:50 -07:00
bors-servo
d66c59a152 Auto merge of #6784 - glennw:offset-ext, r=pcwalton
Implement offsetParent/Top/Left/Width/Height.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6784)
<!-- Reviewable:end -->
2015-08-03 18:39:43 -06:00
bors-servo
ae3aadd656 Auto merge of #6920 - Wafflespeanut:NIT, r=jdm
Removed an invalid FIXME and fixed some doc comments...

There are some bad module-level doc comments in `flow.rs` which has directly affected [Servo's docs](http://doc.servo.org/layout/flow/index.html) and so, this fixes that. Oh, and #6728 is having a hard time getting closed and so I've also removed the `FIXME` comment related to it.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6920)
<!-- Reviewable:end -->
2015-08-03 16:46:12 -06:00
Patrick Walton
ac5e7ec035 construct: When repairing styles for incremental reflow, only repair
styles of nodes that represent the dirty node.

Fixes jumpiness on many pages; e.g. the WPT results pages.

For some reason, this would not reproduce with an automated test.
2015-08-03 15:35:39 -07:00
Matt Brubeck
f8e92b2b01 Implement the unicode-bidi property 2015-08-03 14:12:33 -07:00
Ravi Shankar
5260e64847 Removed an invalid FIXME and fixed a doc comment 2015-08-03 21:51:35 +05:30
Glenn Watson
9e5687e3e7 Implement offsetParent/Top/Left/Width/Height. 2015-08-03 11:55:38 +10:00
Glenn Watson
b9fea3deb3 Fix percentage height calculation, absolute containing block height calculations.
It's not possible to correctly determine during the css cascade whether the container height
is explicitly specified. Additionally, the spec https://drafts.csswg.org/css2/visudet.html#the-height-property
says this should affect the *used* height, rather than the computed height.

This significantly improves the layout in #6643.
2015-08-03 10:47:56 +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
cac01edf80 style: Switch animation timestamps to be doubles instead of floats.
32-bit floats are not enough to hold timestamps since the epoch and
result in jank.
2015-08-01 17:46:39 -07:00
bors-servo
2eb122f394 Auto merge of #6586 - pcwalton:resource-task-ipc, r=jdm
script: Make the resource task communication use IPC channels.

This change makes Servo use serialized messages over IPC channels for resource loading. The goal is to make it easier to make Servo multiprocess in the future. This patch does not make Servo multiprocess now; there are many other channels that need to be changed to IPC before that can happen. It does introduce a dependency on https://github.com/serde-rs/serde and https://github.com/pcwalton/ipc-channel for the first time.

At the moment, `ipc-channel` uses JSON for serialization. This is because serde does not yet have official support for bincode. When serde gains support for bincode, I'll switch to that. For now, however, the JSON encoding and decoding will constitute a significant performance regression in resource loading.

To avoid having to send boxed `AsyncResponseTarget` trait objects across process boundaries, this series of commits changes `AsyncResponseTarget` to wrap a sender only. It is then the client's responsibility to spawn a thread to proxy calls from that sender to the consumer of the resource data. This only had to be done in a few places. In the future, we may want to collapse those threads into one per process to reduce overhead. (It is impossible to continue to use `AsyncResponseTarget` as a boxed trait object across processes, regardless of how much work is done on `ipc-channel`. Vtables are fundamentally incompatible with IPC across mutually untrusting processes.)

In general, I was pretty pleased with how this turned out. The main changes are adding serialization functionality to various objects that `serde` does not know how to serialize natively—the most complicated being Hyper objects—and reworking `AsyncResponseTarget`. The overall structure of the code is unchanged, and other than `AsyncResponseTarget` no functionality was lost in moving to serialization and IPC.

r? @jdm

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6586)
<!-- Reviewable:end -->
2015-07-31 16:06:36 -06:00
bors-servo
a54404c921 Auto merge of #6876 - metajack:slice_chars-layout, r=pcwalton
Use local slice_chars

StrExt::slice_chars is deprecated and will be removed in Rust. This
lifts the implementation from Rust libstd and puts it in util::str.

This fixes a bunch of deprecation warnings in Servo.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6876)
<!-- Reviewable:end -->
2015-07-31 12:54:49 -06:00
Patrick Walton
2aa5174246 script: Make the resource task communication use IPC channels. 2015-07-31 11:28:09 -07:00
Patrick Walton
9c9d7dc93b net: Make most of the resource task messages serializable. 2015-07-31 11:27:49 -07:00
Jack Moffitt
dae1a398a4 Use local slice_chars
StrExt::slice_chars is deprecated and will be removed in Rust. This
lifts the implementation from Rust libstd and puts it in util::str.

This fixes a bunch of deprecation warnings in Servo.
2015-07-31 12:23:13 -06: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
Glenn Watson
7dbffeed20 Fix panic when html element has display: table. 2015-07-31 16:40:06 +10: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