Commit graph

39 commits

Author SHA1 Message Date
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
Tim Taubert
8825296869 Privatize Document 2014-10-13 13:25:43 +02:00
Tim Taubert
df60f8b2c5 Privatize EventTarget and EventListenerEntry 2014-10-13 13:25:43 +02:00
Tim Taubert
9a52bb8310 Privatize InheritTypes 2014-10-13 11:13:12 +02: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
Tim Taubert
35f8270c64 Remove unnecessary deref()s (fixes #3586) 2014-10-09 15:01:54 +02:00
bors-servo
a127fcd854 auto merge of #3577 : ttaubert/servo/issue/3193-named-element-mangle, r=jdm
Should probably use HashMap::entry() but that doesn't seem to be available with servo's current rust snapshot.

r? @Ms2ger
2014-10-08 13:15:32 -06:00
Gilles Leblanc
3a5a66d54e Take the prefix from createElementNS into account for HTML elements
Fixes #3139
2014-10-06 22:49:49 -04:00
Tim Taubert
a338fbc4b5 Use HashMap::find_with_or_insert_with in DocumentHelpers::register_named_element (fixes #3193) 2014-10-06 03:28:15 +02:00
Manish Goregaokar
4f362ab5e6 Remove Untraceable/Traceable from document.rs 2014-10-05 21:58:59 +05:30
Manish Goregaokar
4f574b4732 Remove Traceable from characterdata.rs 2014-10-05 21:33:43 +05:30
Andrew Guertin
815a701455 Replace Cell<Option<JS<T>>> with MutNullableJS<T>
https://github.com/servo/servo/issues/3564
2014-10-03 20:08:05 -04:00
Ms2ger
75ee535e3c Use or_else in Document.find_fragment_node. 2014-10-03 09:20:54 +02:00
Ms2ger
c96018152f Cleanup Document.find_fragment_node. 2014-10-02 19:54:12 +02:00
Ms2ger
5d335fd524 Move find_fragment_node to Document. 2014-10-02 12:04:05 +02:00
Josh Matthews
54fcab61d6 Implement MutNullableJS for mutable, nullable member pointers to DOM objects. 2014-10-01 17:06:23 +02:00
Keegan McAllister
d50114c41d Use string-cache's Namespace type 2014-09-29 21:40:54 -07:00
Keegan McAllister
6429750b33 Eliminate servo_util::atom
We only needed this for Encodable, and now we use JSTraceable instead.
2014-09-29 18:39:36 -07:00
Simon Sapin
b3245fa407 Upgrade to rustc d2b30f7d3 2014-09-23 2014-09-29 17:41:45 +01:00
bors-servo
c10948736f Merge pull request #3497 from zwarich/extended-deref
Add an extended_deref method to JSRef

Reviewed-by: Manishearth
2014-09-27 12:48:30 -06:00
Cameron Zwarich
bad7915914 Make the DocumentHelpers trait use extended_deref 2014-09-26 18:38:58 -07:00
ProgramFOX
71a05a9c39 Made some DOM fields private.
Relevant to #2242.
2014-09-26 20:35:01 +02:00
Manish Goregaokar
95a4731c0e Merge pull request #3468 from Manishearth/jstraceable
Replace our usage our Encodable with JSTraceable; r=jdm
2014-09-24 21:25:41 +05:30
Manish Goregaokar
cc44a3b064 Use JSTraceable everywhere 2014-09-24 05:44:49 +05:30
Ms2ger
d3d7c1dabd Handle null strings in Namespace::new.
This also avoids a string copy in the rare case of an unrecognized namespace.
2014-09-23 22:22:45 +02:00
Tetsuharu OHZEKI
628191e372 Make Document.idmap key to Atom. 2014-09-21 22:38:39 +09:00
Keegan McAllister
dc86e83654 Eliminate warnings 2014-09-20 13:00:55 -07:00
Cameron Zwarich
8aec08074c Remove some extraneous &* pairs 2014-09-20 11:54:11 -07:00
Cameron Zwarich
d768ee77ad Convert various helper traits from &JSRef to JSRef
I converted them all with a few exceptions:

- Methods that were used by trait objects, since trait objects don't
  work with `self` methods.
- Methods that take an &'b JSRef<'a, T> and return an &'b. In reality,
  many (all?) could return an &'a instead, but this isn't allowed by the
  Deref trait.
- Methods that internally rely on the same issue with Deref.
- I left out the traits involved in layout entirely, even though not all
  of their methods suffer from one of the above problems.

There will probably be solutions to all of these problems in the future.
2014-09-20 11:54:11 -07:00
Cameron Zwarich
2c8d51a37c More progress in the &JSRef -> JSRef conversion
Change all of the <Class>Methods traits to take `self` instead of
`&self`.
2014-09-20 11:54:10 -07:00
Cameron Zwarich
4fa8725111 First steps of &JSRef -> JSRef conversion
Replace &JSRef with JSRef in the bulk of the generated code. This will
remove a level of indirection throughout all DOM code.

This patch doesn't change methods implemented on JSRef<T> to take `self`
rather than `&self`, and it leaves a few other uses of &JSRef, but those
changes can be made incrementally.
2014-09-19 13:39:17 -07:00
Chris Paris
92638a6fe6 Implement TreeWalker 2014-09-18 11:13:33 -10:00
Josh Matthews
9607b468bc Revert "script: Use atom comparison in more places, especially for attributes." for persistent test failures.
This reverts commit 874db26104.
2014-09-18 09:20:19 -04:00
Patrick Walton
874db26104 script: Use atom comparison in more places, especially for attributes.
75% improvement in style recalc for Guardians of the Galaxy.
2014-09-17 13:17:12 -07:00
Manish Goregaokar
bded5c3703 Add unrooted_must_root lint for usages of JS<T> in let/for bindings 2014-09-16 22:54:24 +05:30
Manish Goregaokar
12dc54d238 Add unrooted_must_root lint for enums and structs containing JS<T>, as well as functions with JS<T> in their parameter list
For safe wrappers over JS<T> (eg Temporary<T>) use #[allow(unrooted_must_root)].
For all other types containing a #[must_root] value, annotate the type with #[must_root] to ensure that it is never used unrooted
2014-09-16 22:11:27 +05:30
Ms2ger
aa3ca283d4 Remove obsolete FIXME comment. 2014-09-14 10:27:42 +02:00
Tetsuharu OHZEKI
b73b06b9a8 Move Attr helper methods to AttrHelpers trait to avoid to touch them from layout task. 2014-09-11 04:54:38 +09:00
Jack Moffitt
c6ab60dbfc Cargoify servo 2014-09-08 20:21:42 -06:00
Renamed from src/components/script/dom/document.rs (Browse further)