Commit graph

279 commits

Author SHA1 Message Date
Cameron Zwarich
be9618d55b Add a lifetime parameter to the ElementHelper trait
This refines the lifetime used in get_local_name / get_namespace and
makes it independent of the lifetime on the &self parameter.
2014-09-30 21:21:00 -07:00
Cameron Zwarich
3953456b61 Convert a method from &JSRef to JSRef
This also removes the unnecessary formation of a trait object.
2014-09-30 15:55:05 -07: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
Cameron Zwarich
b2a3519011 Remove the 'static lifetime parameters from TElement methods
This improves the static correctness of layout's use of DOM nodes.

Fixes #2595.
2014-09-27 11:14:10 -07:00
Cameron Zwarich
61ae80e186 Add an extra lifetime parameter to TElement / TNode
This isn't used for anything yet, but it's easier to propagate this
change in a separate commit.
2014-09-27 11:14:10 -07: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
Keegan McAllister
a640a7c5c3 Upgrade to rustc 0.12.0-pre (4d2af3861 2014-09-17 15:51:11 +0000) 2014-09-20 13:00:06 -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
Adenilson Cavalcanti
7581335232 Move is_void() Element method together with the other struct methods,
it becomes part of ElementHelpers.
2014-09-20 10:24:57 -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
Josh Matthews
fae7ce3c1d Retrieve some basic layout properties for nodes to make the box model somewhat useful. 2014-09-18 15:07:11 -04: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
11ba79894a Merge pull request #3374 from Manishearth/lint_unrooted_jsmanaged
Add lint for ensuring proper rooting of JS<T>; r=jdm
2014-09-17 18:17:19 +05:30
Manish Goregaokar
30014c3919 Make Reflector #[must_root], propagate to non-HTMLElements 2014-09-17 01:02:41 +05:30
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
Clark Gaebel
acd83ff47b Added a bloom filter to CSS selector matching. 2014-09-15 16:29:45 -07:00
Ms2ger
d0e095a3e5 Stop messing with the case of the attribute name in AttributeHandlers::get_attribute.
This fixes a bug where GetAttributeNS would incorrectly match lower-case
attributes when called with an upper-case argument.
2014-09-13 21:01:54 +02:00
Gilles Leblanc
81a0d065f1 Make use of the list of Atoms in ClassSelector
Make use of the list of Atoms in the class attribute selector
(ClassSelector) in selector_matching.

Fixes #3111
2014-09-11 23:19:26 -04:00
Tetsuharu OHZEKI
a4ec892dbc Move Attr::local_name() to AttrHelpers/AttrHelpersForLayout. 2014-09-11 04:54:38 +09: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/element.rs (Browse further)