Commit graph

63 commits

Author SHA1 Message Date
Ms2ger
647232a495 Wrap SharedLayoutContext::stylist in a wrapper to make it Sync. 2015-11-07 11:23:49 +01:00
Glenn Watson
695b7491fe Change overflow calculation to be calculated after compute_absolute_position.
Also include absolutely positioned elements in the overflow rect calculation.

Fixes #7797.
2015-11-03 20:10:06 +10:00
Ms2ger
9f91984415 Use the passed-in reflow root rather than the one stored in the SharedLayoutContext. 2015-10-26 17:51:26 +01: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
Ms2ger
2bfca9cace Remove the boolean shareable flag in RecalcStyleForNode::process. 2015-10-19 15:01:31 +02:00
Ms2ger
843629b29f Remove the unused boolean in StyleSharingResult::CannotShare. 2015-10-19 15:01:30 +02:00
Ms2ger
f3faaa6b01 Define share_style_if_possible on LayoutElement. 2015-10-19 15:01:29 +02:00
Ms2ger
604601f1f4 Return the result from match_element rather than using an outparam. 2015-10-19 15:01:27 +02:00
Ms2ger
5c7dc4c633 Define match_node on LayoutElement as match_element. 2015-10-19 15:01:26 +02:00
Matt Brubeck
52eda16cca Remove unused PostorderDomTraversal::should_prune 2015-10-01 10:01:07 -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
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
Patrick Walton
475d358b21 layout: Fix tidy failures. 2015-09-01 08:37:41 -07:00
Patrick Walton
b66f17a445 layout: Make overflow calculation take relative percentages into
account.

This necessitated changing overflow to be calculated by the parent flow
if relatively positioned children are present. That is because the
overflow regions cannot be calculated without knowing relative offsets,
which themselves cannot be calculated without knowing the parent size
(because of percentages). To accomplish this without sacrificing
parallelism in the non-relative case, this patch splits overflow into
"early" and "late" computation. Late overflow computation cannot be
parallelized across children, while early overflow computation can.

Makes the "Apple Music" text show up over the full-bleed promotional
background on apple.com.
2015-08-31 16:50:56 -07:00
Johann Tuffe
ec07178b6f sort all uses 2015-08-20 20:47:12 +08:00
Ms2ger
3984e39011 Replace the StyledNode trait with inherent methods. 2015-07-27 19:57:33 +02:00
Simon Sapin
055a1c5cee Update rust-selectors
Update for https://github.com/servo/rust-selectors/pull/37
2015-07-23 18:53:57 +02:00
Ms2ger
4b08cea663 Scope the allowed unsafe code in traversal.rs. 2015-07-17 11:41:06 +02:00
Ms2ger
3e2c44114c Move the traversal traits into the traversal module. 2015-07-17 11:40:40 +02:00
Michael Wu
1a014beb08 Remove LayoutChan from LayoutDataWrapper 2015-07-04 03:54:40 -04:00
Simon Sapin
9e1a674b16 Update rust-selectors 2015-06-26 12:35:08 -07:00
Nicholas Nethercote
9b4d39d6d1 Make LOCAL_CONTEXT_KEY safe and non-leaky.
`LOCAL_CONTEXT_KEY` is currently a `Cell<*mut LocalLayoutContext>`. The use
of the raw pointer means that the `LocalLayoutContext` is not dropped when
the thread dies; this leaks FreeType instances and probably other
things. There are also some unsafe getter functions in `LayoutContext`
(`font_context`, `applicable_declarations_cache` and
`style_sharing_candidate_cache`) that @eddyb says involve undefined
behaviour.

This changeset changes `LOCAL_CONTEXT_KEY` to
`RefCell<Option<Rc<LocalLayoutContext>>>`. This fixes the leak and also
results in safe getters.

(Fixes #6282.)
2015-06-04 20:57:34 -07:00
Corey Farwell
8e3f4bba85 Reduce max line length from 150 to 120 characters
Part of https://github.com/servo/servo/issues/6041
2015-05-24 00:01:49 -04:00
Patrick Walton
6a197719b3 compositing: Implement display ports and avoid creating display lists
for items outside it.

This improves Servo's performance on large pages.
2015-05-19 16:53:51 -07:00
Patrick Walton
72f031e2a1 layout: Support inline incremental reflow, and stop reconstructing all
flows when mousing over the document.

This exposes more "jumpiness" on sites like Hacker News, but the bug
that causes it was pre-existing.
2015-05-19 11:08:27 -07:00
Patrick Walton
b026a8ecf6 layout: Store overflow for flows impacted by floats.
Makes qz.com visible.

In order to work around a compiler bug involving Sized, this patch moves
`store_overflow` to be a virtual method.
2015-05-11 12:59:55 -07: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
Ms2ger
903305416a Implement Clone for Copy types. 2015-04-28 23:31:10 +02:00
Ms2ger
a65c80231a Stop using u/i suffixes in layout. 2015-04-02 15:14:09 +02:00
Patrick Walton
66dd8c8a6c layout: Implement CSS transitions per CSS-TRANSITIONS § 2.
Transition events are not yet supported, and the only animatable
properties are `top`, `right`, `bottom`, and `left`. However, all other
features of transitions are supported. There are no automated tests at
present because I'm not sure how best to test it, but three manual tests
are included.
2015-03-31 08:46:11 -07:00
Ms2ger
9904216d76 Use u32 for generation numbers. 2015-03-28 22:46:16 +01:00
Manish Goregaokar
3479d3fa7f Replace unsafe_blocks by unsafe_code. 2015-03-21 10:27:32 +01:00
Patrick Walton
f9cdd05d58 layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1
§ 12.3-12.5.

Only simple alphabetic and numeric counter styles are supported. (This
is most of them though.)

Although this PR adds a sequential pass to layout, I verified that on
pages that contain a reasonable number of ordered lists (Reddit
`/r/rust`), the time spent in generated content resolution is dwarfed by
the time spent in the parallelizable parts of layout. So I don't expect
this to negatively affect our parallelism expect perhaps in pathological
cases.
2015-03-09 17:13:45 -07:00
bors-servo
a557b51c28 auto merge of #5154 : luniv/servo/viewpoint-percent-lengths, r=SimonSapin
Spec: http://dev.w3.org/csswg/css-values-3/#viewport-relative-lengths
2015-03-05 18:55:02 -07:00
Dan Fox
559ff68b31 Get rid of servo_util 2015-03-05 17:42:05 +00:00
James Gilbertson
00785ecf63 Make the initial viewport size available to style::properties::cascade 2015-03-05 07:09:10 -07:00
Simon Sapin
4c1d778ced Revert "layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1"
This reverts commit 30fd28d107.
2015-03-03 21:16:24 +01:00
Patrick Walton
30fd28d107 layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1
§ 12.3-12.5.

Only simple alphabetic and numeric counter styles are supported. (This
is most of them though.)

Although this PR adds a sequential pass to layout, I verified that on
pages that contain a reasonable number of ordered lists (Reddit
`/r/rust`), the time spent in generated content resolution is dwarfed by
the time spent in the parallelizable parts of layout. So I don't expect
this to negatively affect our parallelism expect perhaps in pathological
cases.
2015-03-03 17:31:19 +01:00
Simon Sapin
2a50755c8a Move selector matching to an external library, for use outside Servo. 2015-02-23 16:29:34 +01:00
Nicholas Nethercote
65cc902564 Update a comment about STYLE_BLOOM. 2015-02-16 14:02:07 -08:00
Nicholas Nethercote
edf00a50fc Avoid bloom filter churn.
When a cached bloom filter is found during traversal, there are two
cases, both of which currently do unnecessary allocations. This patch
avoids these allocations. In the process, it renders correct two
previously-incorrect comments, and moves one of those comments into a
better spot.

While scrolling moderately fast all the way through the "Guardians of
the Galaxy" Wikipedia page, this patch (a) avoids 1.2 million calls to
`clone()` and (b) replaces 111,000 `BloomFilter::new()` calls with
`clear()` calls.
2015-02-15 21:23:35 -08:00
Ms2ger
7c6b03abfe Opt-in rather than opt-out to unsafe blocks in layout. 2015-02-08 20:03:27 +01:00
Ms2ger
c3acbd90d8 Remove transmutes from put_task_local_bloom_filter. 2015-02-08 19:07:19 +01:00
Simon Sapin
d13d36f57f End the libstyle 'pub use' madness. 2015-01-30 15:08:29 +01:00
Josh Matthews
95fc29fa0d Update rustc to 00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev. 2015-01-28 10:16:49 +10:00
Ms2ger
16c7060bc8 Update rustc to revision 2cfb5acb5a2751c759627377e602bac4f88f2d19. 2015-01-08 09:58:46 -05:00
Patrick Walton
5ea2c6dcfd layout: Paint stacking contexts' overflow areas properly.
This was making `box-shadow` not show up in many cases, in particular,
but the effects were not limited to that.
2015-01-04 17:41:59 -08:00
Ms2ger
466faac2a5 Update rustc to revision 3dcd2157403163789aaf21a9ab3c4d30a7c6494d. 2014-12-17 15:19:45 -05:00
Jack Moffitt
d1b433a3b3 Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00