Commit graph

409 commits

Author SHA1 Message Date
bors-servo
fa5ad1c6b4 Auto merge of #7392 - mrobinson:layered-separate, r=pcwalton
Split out layered child stacking contexts in display lists

This patch is in preparation for more dynamic layerization of the
pieces of display lists. It also prevents having to sort the children
by z-index multiple times.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7392)
<!-- Reviewable:end -->
2015-08-26 11:38:34 -06:00
Martin Robinson
1c09b1d8aa Split out layered child stacking contexts in display lists
This patch is in preparation for more dynamic layerization of the
pieces of display lists. It also prevents having to sort the children
by z-index multiple times.
2015-08-26 10:20:28 -07:00
Patrick Walton
5c51a6214e layout: Fix calculation of overflow for stacking contexts that contain
`position: relative` fragments.

Fixes placement of the header on espn.go.com.
2015-08-25 15:08:28 -07:00
Johann Tuffe
ec07178b6f sort all uses 2015-08-20 20:47:12 +08:00
Patrick Walton
277cbf407e gfx: Sort layers according to their Z-index value before handing them
off to the compositor.

Closes #7166.
2015-08-19 16:30:44 -07:00
João Oliveira
067a22a868 Replace uses of for foo in bar.iter(),
and `for foo in bar.iter_mut(), and for foo in bar.into_iter()
(continuation of #7197)
2015-08-18 01:46:11 +01:00
bors-servo
f4b526cfb4 Auto merge of #7222 - pcwalton:dashed-border-radius, r=glennw
gfx: Paint dashed borders with nonzero radii the same way Gecko does.

It's not ideal, but it was easy to implement and will do for now.

Closes #7157.

r? @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7222)
<!-- Reviewable:end -->
2015-08-17 16:53:58 -06:00
João Oliveira
1e20447746 replace len() !=0 with !is_empty() 2015-08-17 02:56:07 +01: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
Patrick Walton
3f4487d81d gfx: Paint dashed borders with nonzero radii the same way Gecko does.
It's not ideal, but it was easy to implement and will do for now.

Closes #7157.
2015-08-14 16:42:47 -07:00
bors-servo
85022a4c34 Auto merge of #7208 - jxs:master, r=Ms2ger
replace .len() == 0 with is_empty()

closes #7198

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7208)
<!-- Reviewable:end -->
2015-08-14 00:51:59 -06:00
João Oliveira
9c11781880 replace .len() == 0 with is_empty()
closes #7198
2015-08-14 04:00:33 +01:00
Glenn Watson
8218ead707 Fix "'PaintWorker' panicked at 'index 0 and/or 4 in * do not lie on character boundary" when printing display list.
This whole piece of code seems a bit fragile, but it fixes the immediate problem for now.
2015-08-14 11:48:36 +10:00
Glenn Watson
be8864ae5c Enable item clipping on normal transform layers. Fixes rounded corners on layers with 2d transforms.
Needed for #6643.
2015-08-13 16:03:25 +10:00
Corey Farwell
df79c8f8fa Utilize match guard; make methods more similar
Make the structure for the `stretchiness` and `boldness` methods more
similar
2015-08-11 18:28:50 -04:00
bors-servo
7dc83e7820 Auto merge of #7024 - pcwalton:whitespace-stripping, r=mbrubeck
layout: Rewrite whitespace stripping.

This patch makes Servo unconditionally strip whitespace before text run
scanning (assuming that the `white-space` property allows it). Whitespace
stripping during reflow is now only used for handling whitespace at the ends of
lines; reflow now never attempts to handle ignorable whitespace.

Many CSS tests pass now. There are some new failures, however.

The following reference tests now fail due to a pre-existing bug whereby
whitespace is used to calculate the position of inline hypothetical boxes for
elements with `display: inline; position: absolute`:

* `absolute-replaced-height-036.htm`
* `vertical-align-sub-001.htm`
* `vertical-align-super-001.htm`

The following reference tests fail due to a pre-existing bug whereby we don't
handle `font-size: 0` properly in inline reflow:

* `font-size-zero-1.htm`
* `font-size-zero-2.htm`

The following reference test fails due to the fact that it relied on our
incorrect insertion of whitespace to make room for the black background:

* `inline-formatting-context-007.htm`

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7024)
<!-- Reviewable:end -->
2015-08-11 12:57:02 -06:00
Patrick Walton
ae378a8c3e layout: Rewrite whitespace stripping.
This patch makes Servo unconditionally strip whitespace before text run
scanning (assuming that the `white-space` property allows it). Whitespace
stripping during reflow is now only used for handling whitespace at the ends of
lines; reflow now never attempts to handle ignorable whitespace.

Many CSS tests pass now. There are some new failures, however.

The following reference tests now fail due to a pre-existing bug whereby
whitespace is used to calculate the position of inline hypothetical boxes for
elements with `display: inline; position: absolute`:

* `absolute-replaced-height-036.htm`
* `vertical-align-sub-001.htm`
* `vertical-align-super-001.htm`

The following reference tests fail due to a pre-existing bug whereby we don't
handle `font-size: 0` properly in inline reflow:

* `font-size-zero-1.htm`
* `font-size-zero-2.htm`

The following reference test fails due to the fact that it relied on our
incorrect insertion of whitespace to make room for the black background:

* `inline-formatting-context-007.htm`
2015-08-11 11:42:20 -07:00
bors-servo
7ce47266ac Auto merge of #7137 - pcwalton:absolute-stacking-contexts, r=glennw
layout: Make absolutely-positioned elements with `z-index: auto` not stacking contexts.

Improves many sites.

Closes #7069.

r? @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7137)
<!-- Reviewable:end -->
2015-08-11 12:22:14 -06:00
Patrick Walton
67d86ac507 gfx: Print the color of solid color display items when dumping the
display list.
2015-08-11 11:21:53 -07:00
bors-servo
9c528c6382 Auto merge of #7161 - mbrubeck:underline, r=pcwalton
Snap rectangles to nearest pixels consistently.

Snapping the top-left and bottom-right corners separately can cause a rectangle to change size or even become empty when offset by a subpixel amount.  Instead, this patch snaps the top-left corner, then snaps the size to a whole pixel amount, so any rectangle of a given original size will always have the same snapped size.

Fixes #7152. r? @pcwalton or @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7161)
<!-- Reviewable:end -->
2015-08-11 11:31:32 -06:00
Matt Brubeck
3b6dc09e47 Snap rectangles to nearest pixels consistently.
Snapping the top-left and bottom-right corners separately can cause a
rectangle to change size when offset by a subpixel amount.  Instead, this
patch snaps the top-left corner, then rounds the size to a whole pixel amount,
so any rectangle of a given size will always have the same snapped size.

Fixes #7152.
2015-08-11 10:30:32 -07:00
Patrick Walton
bf26a2373f layout: Carry out some minor style cleanups. 2015-08-10 21:27:05 -07: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
Glenn Watson
30d9e75557 Update rust-layers to get 2d transform + clipping support. 2015-08-11 08:48:44 +10: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
bors-servo
50a30121bf Auto merge of #7021 - glennw:fix-7018, r=pcwalton
Fix display list optimization on retina displays. Fixes #7018.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7021)
<!-- Reviewable:end -->
2015-08-06 23:26:24 -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
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
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
Glenn Watson
6333961844 Fix display list optimization on retina displays. Fixes #7018. 2015-08-06 14:11:27 +10: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
bors-servo
315c4f5ed7 Auto merge of #6983 - glennw:tf2, r=pcwalton
Support transforms for display list optimization. Prevents clipping in #6643.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6983)
<!-- Reviewable:end -->
2015-08-05 12:50:36 -06:00
bors-servo
11acfbc29f Auto merge of #6981 - pcwalton:github-font-fallback, r=metajack
gfx: Fix Core Text font instantiation for Web fonts on Mac.

r? @metajack

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6981)
<!-- Reviewable:end -->
2015-08-05 06:11:36 -06:00
bors-servo
0d8825c25c Auto merge of #6959 - servo:warnings_, r=jdm
Fix warnings

Adds on top of #6949.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6959)
<!-- Reviewable:end -->
2015-08-05 03:44:22 -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
Glenn Watson
11b1c19b05 Support transforms for display list optimization. Prevents clipping in #6643. 2015-08-05 11:48:07 +10:00
Patrick Walton
d6b9e3bdfd gfx: Fix Core Text font instantiation for Web fonts on Mac.
Fixes GitHub Octicons. A reftest has been added for this.
2015-08-04 17:07:44 -07:00
David Zbarsky
9fbe33b6f2 Implement strokeRect with zero-width or zero-height rects 2015-08-04 17:44:18 -04:00
Josh Matthews
039929da5c Warning police.
Closes #6949.
2015-08-04 15:16:15 +02:00
bors-servo
d77f9415c5 Auto merge of #6937 - mbrubeck:hb_funcs, r=glennw
Store Harfbuzz callback functions in a static var

r? gw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6937)
<!-- Reviewable:end -->
2015-08-03 22:40:35 -06:00
Matt Brubeck
47a0d494ec Make Harfbuzz font_funcs static 2015-08-03 15:30:46 -07:00
Matt Brubeck
f1e268b1e8 Sort gfx crates.io dependencies and move to top 2015-08-03 15:30:46 -07:00
Matt Brubeck
f8e92b2b01 Implement the unicode-bidi property 2015-08-03 14:12:33 -07: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
2aa5174246 script: Make the resource task communication use IPC channels. 2015-07-31 11:28:09 -07:00
Patrick Walton
e9ec9289d6 gfx: Instantiate the CTFont corresponding to a Mac font on demand.
This avoids panics in multiprocess mode.
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
Patrick Walton
f041e1aa60 util: Remove the old broken SerializableLinkedList code in favor of
serde's native implementation.
2015-07-31 08:42:29 -07:00