Commit graph

63 commits

Author SHA1 Message Date
Ms2ger
fa31d7d909 Replace TElement::get_link() by specific methods. 2015-05-11 10:52:58 +02:00
Simon Sapin
ef8edd4e87 Upgrade to rustc 551a74dddd84cf01440ee84148ebd18bc68bd7c8. 2015-05-05 10:07:34 -04:00
Jinwoo Song
f404853c99 Make NodeTypeId include CharacterData variant
NodeTypeId is supposed to reflect the WebIDL inheritance hierarchy.
All of Text/ProcessingInstruction/Comment inherit from CharacterData,
which inherits from Node. There should be a CharacterDataTypeId value
that differentiates between those, instead.
2015-04-29 13:30:21 +09:00
Ms2ger
ed052bc080 Move the sink into util::vec. 2015-04-27 23:44:22 +02:00
Ms2ger
811ea395bc Avoid creating a vector in can_share_style_with. 2015-04-27 20:25:19 +02:00
Ms2ger
582ee1c2b3 Create a new infrastructure for presentational hints. 2015-04-26 21:25:06 +02:00
Ms2ger
6a55ae06d7 Remove some as_slice calls. 2015-04-24 17:44:47 +02:00
Peter
881112d34e Adding cmdling argument for disabling style share cache, fix #5581 2015-04-09 21:42:41 -04: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
d2252a7214 Use usize for cache indices. 2015-03-29 12:46:28 +02:00
Ms2ger
803eba0e59 Use usize for cache sizes. 2015-03-29 12:45:19 +02:00
Ms2ger
339ab881a2 Use usize in ApplicableDeclarationsCacheQuery's hash method. 2015-03-29 12:45:07 +02:00
Manish Goregaokar
3479d3fa7f Replace unsafe_blocks by unsafe_code. 2015-03-21 10:27:32 +01:00
Ms2ger
5f15eb5fbf Upgrade rustc to d3c49d2140fc65e8bb7d7cf25bfe74dda6ce5ecf/rustc-1.0.0-dev. 2015-03-18 13:18:31 -04:00
James Gilbertson
fafc357308 Fix broken viewport percentage length units after a viewport resize.
When a viewport is resized, the computed values for a style containing viewport percentage length units become stale. However, there's no way for those styles to be invalidated after a resize. As a solution, this commit invalidates the computed values cache after a resize has occurred, which is probably over-kill.

A better solution would probably be to track under what conditions computed values remain valid, and invalidate them as indicated.
2015-03-08 13:06:27 -06: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
Dan Fox
3441b2c329 layout/layout_data.rs -> layout/data.rs 2015-03-03 19:59:38 +00:00
Dan Fox
dd0df4e9c5 Rename util.rs -> layout_data.rs 2015-03-03 18:12:06 +00:00
Simon Sapin
2a50755c8a Move selector matching to an external library, for use outside Servo. 2015-02-23 16:29:34 +01:00
Ms2ger
2b0eb98c1d Fix some warnings in layout. 2015-02-12 18:58:38 +01:00
Ms2ger
7c6b03abfe Opt-in rather than opt-out to unsafe blocks in layout. 2015-02-08 20:03:27 +01:00
Simon Sapin
d13d36f57f End the libstyle 'pub use' madness. 2015-01-30 15:08:29 +01:00
Manish Goregaokar
b68b7e87c8 self import 2015-01-28 13:46:00 +05:30
Josh Matthews
95fc29fa0d Update rustc to 00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev. 2015-01-28 10:16:49 +10:00
Ms2ger
01ed338746 Move to to_owned rather than into_string.
into_string has been removed from Rust.
2015-01-20 14:49:07 +01:00
Ms2ger
b14a94a30f Pass a Vec to ApplicableDeclarationsCacheEntry::new.
As it copies the slice anyway, it is better to give the caller the opportunity
to pass in an existing Vec.
2015-01-09 13:30:43 +01:00
Ms2ger
16c7060bc8 Update rustc to revision 2cfb5acb5a2751c759627377e602bac4f88f2d19. 2015-01-08 09:58:46 -05:00
Ms2ger
0031498e6b Remove some transmute calls. 2014-12-27 17:07:32 +01:00
Manish Goregaokar
c7dfb1d24b layout: to_string() -> into_string() 2014-12-27 14:48:36 +01:00
Tetsuharu OHZEKI
135ee60f5a style: Remove glob imports added in #4405 2014-12-19 01:49:24 +09:00
Ms2ger
466faac2a5 Update rustc to revision 3dcd2157403163789aaf21a9ab3c4d30a7c6494d. 2014-12-17 15:19:45 -05:00
Patrick Walton
10f1ed5e31 style: Parse the legacy border attribute per the legacy HTML specification.
Additionally, this patch cleans up some miscellaneous formatting issues
and refactors files in `layout/css/` somewhat to eliminate needless
levels of indirection. It also fixes our handling of presentational
hints that only apply if border is nonzero.
2014-12-15 17:41:37 -08:00
Jack Moffitt
d1b433a3b3 Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
Patrick Walton
08fc7c2795 layout: Make incremental reflow more fine-grained by introducing "reflow
out-of-flow" and "reconstruct flow" damage bits.

This is needed for good performance on the maze solver.
2014-10-31 12:24:40 -07:00
bors-servo
ba13e448cf auto merge of #3838 : pcwalton/servo/style-sharing-enhancements, r=SimonSapin
This helps avoid problems with style sharing in common cases, often
caused by the user agent stylesheet.

r? @SimonSapin
2014-10-30 16:33:36 -06:00
Clark Gaebel
314a0d671e layout: Actually calculate restyle damage while styling.
...oops. Looks like I forgot to do this.

r? @pcwalton
2014-10-29 09:34:08 -07:00
Patrick Walton
4bf0acbe38 layout: Support more types of selectors for style sharing.
This helps avoid problems with style sharing in common cases, often
caused by the user agent stylesheet.
2014-10-28 14:12:50 -07:00
Patrick Walton
68091d7a86 layout: Make some formatting cleanups.
These should have no effect on functionality.
2014-10-28 12:00:35 -07:00
Clark Gaebel
481adcd654 Fix whitespace_pre with incremental reflow turned on.
This implements fragment merging, in order to incrementally reflow linebroken
text. This makes the `whitespace_pre.html` reftest pass with incremental reflow
turned on with `-i`.
2014-10-15 16:04:21 -07:00
Clark Gaebel
7368d42225 Removes duplicate CSS selector matching logic.
Now that DOM/Flow traversals have been refactored out, the `recalc_style_for_subtree`
function in `css/matching.rs` can be removed, in lieu of just running the standard
`recalc_style_for_node` and `construct_flows` traversals sequentially. Now we
no longer have the maintenance headache of duplicating selector matching logic
in two places! \o/

r? @pcwalton
2014-10-14 16:28:29 -07:00
bors-servo
56989b8dec auto merge of #3640 : cgaebel/servo/incremental-flow-construction, r=pcwalton
This also hides the not-yet-working parts of incremental reflow behind a runtime
flag. As I get the failing reftests passing, I'll send pull requests for them one
by one.
2014-10-14 16:51:30 -06:00
Clark Gaebel
f552e2f750 try to reset flows which need reflow, since reflow isn't yet idempotent 2014-10-14 10:33:46 -07:00
Patrick Walton
ee2ccc4f87 script: Use atom comparison in more places, especially for attributes.
75% improvement in style recalc for Guardians of the Galaxy.
2014-10-14 10:32:40 -07:00
Patrick Walton
2a790d06dd Use Gecko's simpler Bloom filter instead of one based on hash
stretching.

This preserves the usage of the Bloom filter throughout style recalc,
but the implementation is rewritten. Provides a 15% improvement on
Guardians of the Galaxy.
2014-10-10 17:02:27 -07:00
Clark Gaebel
a29dc2c979 removed restyledamage 2014-10-09 12:55:25 -04:00
Clark Gaebel
d12c6e7383 Incremental Style Recalc
This patch puts in the initial framework for incremental reflow. Nodes' styles
are no longer recalculated unless the node has changed.

I've been hacking on the general problem of incremental reflow for the past
couple weeks, and I've yet to get a full implementation that actually passes all
the reftests + wikipedia + cnn. Therefore, I'm going to try to land the different
parts of it one by one.

This patch only does incremental style recalc, without incremental flow
construction, inline-size bubbling, reflow, or display lists. Those will be coming
in that order as I finish them.

At least with this strategy, I can land a working version of incremental reflow,
even if not yet complete.

r? @pcwalton
2014-10-09 12:55:21 -04:00
Patrick Walton
a0b369ae7d layout: Mark the styles of elements with pseudos as unshareable.
Makes multiple `<br>` elements work, since those are implemented via
`before` pseudos.
2014-10-08 22:46:54 -07:00
Keegan McAllister
d50114c41d Use string-cache's Namespace type 2014-09-29 21:40:54 -07:00