Commit graph

124 commits

Author SHA1 Message Date
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
Johann Tuffe
ec07178b6f sort all uses 2015-08-20 20:47:12 +08: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
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
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
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
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
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
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
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
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
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
f041e1aa60 util: Remove the old broken SerializableLinkedList code in favor of
serde's native implementation.
2015-07-31 08:42:29 -07:00
Glenn Watson
ddef25030b Accumulate and invert stacking context transform for hit tests.
This makes hit tests work on stacking contexts with transforms.

Ref #6643.
2015-07-28 14:38:09 +10:00
Bogdan Cuza
681b11c08b Fix #6680 2015-07-22 16:45:43 +03:00
Patrick Walton
6eacb0c995 gfx: Make display lists serializable using serde.
This commit introduces the `serde` dependency, which we will use to
serialize messages going between processes in multiprocess Servo.

This also adds a new debugging flag, `-Z print-display-list-json`,
allowing the output of display list serialization to be visualized.
This will be useful for our experiments with alternate rasterizers.
2015-07-15 19:04:17 -07:00
Patrick Walton
3500af37d0 gfx: Use a pattern instead of tiling images manually. 2015-07-07 10:41:47 -07:00
Glenn Watson
39ddbbb0e1 Implement enough of 3d transforms spec to run the CSS FPS demo. 2015-06-23 14:10:44 +10:00
ecoal95
8cbfb3482c Use euclid from crates.io 2015-06-19 00:04:24 +02:00
Corey Farwell
5c408d2be9 rust-geom API changes
https://github.com/servo/rust-geom/pull/81
2015-06-13 12:28:21 -07:00
Glenn Watson
899ab226de Updates for changes in rust-geom and rust-layers 2015-06-11 07:19:58 +10:00
Patrick Walton
e42011cd53 Revert "Updates for changes in rust-geom and rust-layers" 2015-06-10 14:14:51 -07:00
Patrick Walton
053296e131 Merge pull request #6329 from glennw/remove-generic
Updates for changes in rust-geom and rust-layers
2015-06-10 14:14:24 -07:00
Glenn Watson
8fb29c91e6 Updates for changes in rust-geom and rust-layers 2015-06-11 07:05:56 +10:00
Corey Farwell
4f47b41fa7 Remove fnv & smallvec crate reexports from util
The util component specified fnv and smallvec as dependencies and publicly
reexported both of them. Several other components utilized these reexports,
presumably because fnv and smallvec used to live in the tree so reexporting
made the transition easier.

These indirect dependencies through the util component are unnecessary.

This commit removes the fnv & smallvec crate reexports in the util component.
It exchange, it adds fnv & smallvec as dependencies to non-util components
wherever needed. Finally, it removes the fnv dependency from util as it is not
utilized anywhere in the util component.
2015-06-10 07:14:55 -07:00
Manish Goregaokar
ea9842723d Audit and reduce unstable usage in gfx
Reasons behind existing unstable features:

alloc:

 - weak pointers (may not belong)
 - boxed::into_raw and from_raw (naming)

collections:

 - `Vec.push_all()` (May be replaced)
   - Replace with loop

core:

 - `min_by` (#15311)
 - `PI_2` (naming)

rustc_private:

 - FnVHasher
   - Can be replaced by rust-fnv

std_misc:

 - Hash state stuff (no option here unless we want to stop using it)

str_char:

 - CharRange usage
   - Can be replaced by regular iterators (char_indices)
2015-06-09 23:24:18 +05:30
Manish Goregaokar
d347aeda38 fix rebase conflicts 2015-06-03 09:56:43 +05:30
Manish Goregaokar
13b4bcfbb7 Remove all Arc-less ignores, force reasons, ignore_heap_size_of 2015-06-03 07:14:21 +05:30
Manish Goregaokar
5447d2af3d remove more heapsize ignores 2015-06-03 07:14:20 +05:30
Manish Goregaokar
a5975e8f33 use knownheapsize for geom stuff 2015-06-03 07:14:18 +05:30
Manish Goregaokar
c1daf889af use HeapSizeOf plugin in gfx 2015-06-03 07:13:40 +05:30
Glenn Watson
f47ba6fd33 First step towards 3d transforms.
* Add parser support for 3d transforms.
 * Change ComputedMatrix to a representation that suits interpolation.
 * Switch stacking contexts to use 4x4 matrices.

The transforms themselves are still converted to 2d and handled by azure for now, but this is a small standalone part that can be landed now to make it easier to review.
2015-05-29 09:47:38 +10:00
Patrick Walton
a299a2c71c layout: Minor whitespace and formatting cleanups. 2015-05-13 12:00:55 -07:00
Patrick Walton
711993eb46 gfx: Print out stacking context info when dumping display lists. 2015-05-13 12:00:54 -07:00
Patrick Walton
87a620e1b3 layout: Draw elements with position: relative; z-index: auto over
ordinary content per CSS 2.1 Appendix E.

Improves Talking Points Memo.
2015-05-12 17:32:59 -07:00
Simon Sapin
908be6abc2 Rename some to_azure* methods according to what they do. 2015-05-05 20:13:30 +02:00
Simon Sapin
8b522f2e7d Rename Au methods with f32/f64 instead of frac32/frac/subpx 2015-05-05 18:23:29 +02:00
Simon Sapin
ef8edd4e87 Upgrade to rustc 551a74dddd84cf01440ee84148ebd18bc68bd7c8. 2015-05-05 10:07:34 -04:00
Glenn Watson
a5a5214783 Various fixes to getClientBoundingRect()
* Fix queries involving stacking contexts
 * The code was double accumulating stacking context origins.
* Handle queries of inline elements.
 * The node addresses being compared were incorrect (CharacterData vs. Span)
* Handle ScriptQuery reflows correctly.
 * The layout task was skipping the compute absolute positions traversal, so failed before window.onload.
2015-05-01 12:40:37 +10:00
Patrick Walton
48299a53cb layout: Implement most of border-collapse per CSS 2.1 § 17.6.2.
Known issues:

* Collapsed borders do not correctly affect the border-box of the table
  itself.

* The content widths of all cells in a column and the content height of
  all cells in a row is the same in this patch, but not in Gecko and
  WebKit.

* Corners are not painted well. The spec does not say what to do here.

* Column spans are not handled well. The spec does not say what to do
  here either.
2015-04-27 17:12:07 +02:00
Ms2ger
4d41f1c991 Stop using the deprecated range function. 2015-04-22 20:26:40 +02:00