Anthony Ramine
0b3ab875f4
Remove intrinsic Root::r()
2016-10-11 19:44:32 +02:00
Anthony Ramine
fcb59d3057
Make reflect_dom_object take a &GlobalScope
2016-10-06 20:59:09 +02:00
Anthony Ramine
7dfb336be8
Use Option<T> to return from getters
...
This removes the cumbersome &mut bool argument and offers overall
a more readable code.
2016-08-30 19:07:19 +02:00
Ms2ger
0addbe36b0
Update to rustc 2016-06-14.
2016-06-15 00:27:36 +01:00
Anthony Ramine
b45f1918d1
Remove JS::from_rooted
2016-05-31 14:43:58 +02:00
Keith Yeung
4229b68062
Implement NamedItem and NamedGetter on HTMLFormControlsCollection
2016-01-28 18:33:51 -05:00
Keith Yeung
9e3af70941
Implement RadioNodeList
2016-01-24 13:05:47 -05:00
rohan.prinja
6e774ea6eb
merge from master
2015-11-03 19:01:23 +09:00
Corey Farwell
9df375195e
Implement 'labels' attribute on 'labelable elements'
2015-11-01 09:50:14 -05:00
nxnfufunezn
d8ef3809a6
Removed JS::root Fixes #8251
2015-10-31 18:15:16 +05:30
rohan.prinja
45224028db
more refactoring
2015-10-30 20:26:29 +09:00
Eli Friedman
a9ef40c716
Don't allow unrooted values in function arguments.
2015-10-23 14:44:19 -07:00
Anthony Ramine
17cd4202e7
Do not root ChildrenList::node
2015-10-19 09:37:04 +02:00
Eli Friedman
9de42c8935
Simplify extracting a reference from an Option<Root<T>>, per review comments.
2015-10-15 14:03:58 -07:00
Eli Friedman
5bdf6bb1d3
Fix remaining MutHeap methods not to expose JS<T>.
2015-10-15 14:03:57 -07:00
Eli Friedman
57584e74c6
Make get() and set() on MutNullableHeap use the correct types.
...
get() must always return a rooted value, because we have no way of
ensuring the value won't be invalidated. set() takes an &T because it's
convenient; there isn't any need to expose JS<T>.
2015-10-15 14:03:56 -07:00
Eli Friedman
88a1cbb28b
Stop implementing Copy for JS<T>.
...
A copy of a JS<T> doesn't have the rooting properties of the original,
so it makes no sense for it to implement Copy.
2015-10-15 14:02:45 -07:00
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
bors-servo
86da67bb1e
Auto merge of #7407 - nox:childnodes-replace, r=jdm
...
Optimise most basic case of .replaceChild() when updating childNodes
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png " height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7407 )
<!-- Reviewable:end -->
2015-08-30 13:22:41 -06:00
Anthony Ramine
709d347872
Make the traits for the IDL interfaces take &self
2015-08-27 22:27:43 +02:00
Anthony Ramine
c831c2c0a5
Remove helper traits
...
Now that JSRef<T> is gone, there is no need to have helper traits.
On components/script/*.rs:
# Remove imports.
/^ *use dom::[a-z]+::\{.*Helpers/ {
s/\{(Raw[^L]|[^L][^a])[a-zA-Z]+Helpers, /\{/
s/, (Raw[^L]|[^L][^a])[a-zA-Z]+Helpers([,}])/\2/g
s/\{([a-zA-Z]+)\}/\1/
/\{\}/d
s/::self;$/;/
}
/^ *use dom::[a-z]+::\{?(Raw[^L]|[^L][^a])[a-zA-Z]+Helpers\}?;$/d
On components/script/dom/*.rs:
# Ignore layout things.
/^(pub )?(impl|trait).*Layout.* \{/,/^}$/ { P; D; }
# Delete helpers traits.
/^(pub )?trait ([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? \{$/,/^\}$/D
# Patch private helpers.
/^impl.*Private.*Helpers/,/^\}$/ {
s/^impl<'a> Private([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? for &'a ([^ ]+) \{$/impl \3 {/
/^ *(unsafe )?fn .*\(self.*[<&]'a/ {
s/&'a /\&/g
s/<'a, /</g
}
/^ *(unsafe )?fn /s/\(self([,)])/\(\&self\1/
}
# Patch public helpers.
/^impl.*Helpers/,/^\}$/ {
s/^impl(<'a>)? ([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? for (&'a )?([^ ]+) \{$/impl \5 {/
/^ *(unsafe )?fn .*\(self.*[<&]'a/ {
s/&'a /\&/g
s/<'a, /</g
}
/^ *(unsafe )?fn .*\(&?self[,)]/s/(unsafe )?fn/pub &/
/^ *pub (unsafe )?fn /s/\(self([,)])/\(\&self\1/
}
The few error cases were then fixed by hand.
2015-08-27 16:59:02 +02:00
Anthony Ramine
faa581be86
Optimise most basic case of .replaceChild() when updating childNodes
2015-08-27 13:47:25 +02:00
João Oliveira
fd87c8cb3e
make dom_struct derive HeapSizeOf,
...
closes #7357
2015-08-27 01:17:48 +01:00
Bogdan Cuza
45145108da
Measure heap memory usage for more types. Fixes #6951
2015-08-13 21:44:41 +03:00
Anthony Ramine
4e8922a53a
Optimise Node.childNodes
...
We use the virtual method children_changed() to propagate changes in the children
list to the NodeList tied to Node.childNodes.
2015-08-09 00:10:21 +02:00
Bogdan Cuza
233a769c67
Add spec links
2015-07-28 13:28:41 +02:00
David Winslow
4cf46bff2d
Refactor #[jstraceable] to #[derive(JSTraceable)]
...
fixes #6524
2015-07-01 18:27:06 -04:00
Michael Wu
675267b782
Upgrade to SM 39
2015-06-19 18:42:48 -04:00
Anthony Ramine
81cacdf820
Remove use of RootedVec in NodeList
2015-05-26 15:35:16 +02:00
Anthony Ramine
1a30925cad
Remove Temporary::new()
...
Temporary::from_rooted() now takes an Assignable value.
2015-04-28 09:22:46 +02:00
Anthony Ramine
7197052c0d
Uniformise root() methods
...
They now live in traits Rootable, OptionalOptionalRootable, OptionalRootable
and ResultRootable.
2015-04-28 09:22:45 +02:00
Anthony Ramine
c026825e69
Pass a RootedVec to NodeList::new_simple_list()
2015-04-13 11:00:04 +02:00
Ms2ger
c8106da277
Rewrite NodeChildrenIterator to return Temporary.
2015-04-02 13:07:51 +02:00
Corey Farwell
46f14449d0
Add links to spec for script::dom structs/methods
2015-03-28 20:04:30 -04:00
Ms2ger
6d30ec77c8
Replace uint/int by usize/isize in various places.
2015-02-20 14:45:47 +01:00
Ms2ger
1dad710063
Replace Root::deref() calls by Root::r() calls where possible.
...
This changes those calls that were already sound.
2015-01-01 20:36:43 +01:00
Manish Goregaokar
21a888341d
Ensure that Reflectors are the first field
2014-12-27 02:53:36 +05:30
Manish Goregaokar
552db382d6
Remove manual impls of Reflectors (autogen)
...
Obtained via:
`find . -maxdepth 1 -type f -print0 | xargs -0 sed -z -i "s/\\nimpl Reflectable for[^{]*{[^}]*}[^}]*}\\n//"`
`find . -maxdepth 1 -type f -print0 |xargs -0 grep -lZ dom_struct | xargs -0 grep -LZ "reflector()\\|Reflector::new" |xargs -0 sed -z -i "s/use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};/use dom::bindings::utils::reflect_dom_object;/"`
followed by semi-automated removal of leftover imports
2014-12-27 02:52:33 +05:30
Tetsuharu OHZEKI
a7bb436177
script: Remove glob imports added in #4405
2014-12-19 04:52:48 +09:00
Ms2ger
466faac2a5
Update rustc to revision 3dcd2157403163789aaf21a9ab3c4d30a7c6494d.
2014-12-17 15:19:45 -05:00
Michael Booth
2cbf5a3671
Updated reflect_dom_object to be passed by value
2014-11-30 19:47:52 +00:00
Manish Goregaokar
3f2cbb275b
Use #[dom_struct] everywhere
2014-10-16 10:20:18 +05:30
Tim Taubert
acd98a73a4
Simple privatizations
2014-10-13 11:13:12 +02:00
Tim Taubert
35f8270c64
Remove unnecessary deref()
s ( fixes #3586 )
2014-10-09 15:01:54 +02:00
Simon Sapin
b3245fa407
Upgrade to rustc d2b30f7d3 2014-09-23
2014-09-29 17:41:45 +01:00
ProgramFOX
71a05a9c39
Made some DOM fields private.
...
Relevant to #2242 .
2014-09-26 20:35:01 +02:00
Manish Goregaokar
cc44a3b064
Use JSTraceable everywhere
2014-09-24 05:44:49 +05:30
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
Manish Goregaokar
30014c3919
Make Reflector #[must_root], propagate to non-HTMLElements
2014-09-17 01:02:41 +05:30