aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/js.rs
Commit message (Collapse)AuthorAgeFilesLines
...
| * make changes according to code review (#8097)Rohan Prinja2015-10-241-15/+26
| |
| * add equal() methods for comparisons with other typesRohan Prinja2015-10-221-1/+11
| |
| * in PartialEq impls, use Self instead of explicitly naming the struct typeRohan Prinja2015-10-221-2/+2
| |
| * implement PartialEq for MutHeap<JS<T>> and MutNullableHeap<JS<T>>Rohan Prinja2015-10-211-0/+12
| |
* | Make unrooted_must_root a bit more aggressive.Eli Friedman2015-10-231-0/+2
| | | | | | | | | | | | | | | | | | Basically, instead of trying to check for specific kinds of statements, just check the types of all local variables. Also included are some commented-out proposals for some slightly more aggressive lints which might be useful (but trigger a little too frequently at the moment).
* | Fix type in MutHeap docsMatt Brubeck2015-10-211-2/+2
| |
* | Auto merge of #8041 - nox:castable, r=jdmbors-servo2015-10-211-0/+36
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce trait Castable Removes all those messy FooCast structures in InheritTypes.rs. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8041) <!-- Reviewable:end -->
| * | Introduce trait CastableAnthony Ramine2015-10-211-0/+36
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This trait is used to hold onto the downcast and upcast functions of all castable IDL interfaces. A castable IDL interface is one which either derives from or is derived by other interfaces. The deriving relation is represented by implementations of marker trait DerivedFrom<T: Castable> generated in InheritTypes. /^[ ]*use dom::bindings::codegen::InheritTypes::.*(Base|Cast|Derived)/ { /::[a-zA-Z]+(Base|Cast|Derived);/d s/([{ ])[a-zA-Z]+(Base|Cast|Derived), /\1/g s/([{ ])[a-zA-Z]+(Base|Cast|Derived), /\1/g s/, [a-zA-Z]+(Base|Cast|Derived)([},])/\2/g s/, [a-zA-Z]+(Base|Cast|Derived)([},])/\2/g /\{([a-zA-Z]+(Base|Cast|Derived))?\};$/d s/\{([a-zA-Z_]+)\};$/\1;/ } s/([a-zA-Z]+)Cast::from_ref\(\&?\**([a-zA-Z_]+)(\.r\(\))?\)/\2.upcast::<\1>()/g s/([a-zA-Z]+)Cast::from_ref\(\&?\**([a-zA-Z_]+)(\.[a-zA-Z_]+\(\))?\)/\2\3.upcast::<\1>()/g s/\(([a-zA-Z]+)Cast::from_ref\)/\(Castable::upcast::<\1>\)/g s/([a-zA-Z]+)Cast::from_root/Root::upcast::<\1>/g s/([a-zA-Z]+)Cast::from_layout_js\(\&([a-zA-Z_.]+)\)/\2.upcast::<\1>()/g s/([a-zA-Z]+)Cast::to_ref\(\&?\**([a-zA-Z_]+)(\.r\(\))?\)/\2.downcast::<\1>()/g s/([a-zA-Z]+)Cast::to_ref\(\&?\**([a-zA-Z_]+)(\.[a-zA-Z_]+\(\))?\)/\2\3.downcast::<\1>()/g s/\(([a-zA-Z]+)Cast::to_ref\)/\(Castable::downcast::<\1>\)/g s/([a-zA-Z]+)Cast::to_root/Root::downcast::<\1>/g s/([a-zA-Z]+)Cast::to_layout_js\(&?([a-zA-Z_.]+(\(\))?)\)/\2.downcast::<\1>()/g s/\.is_document\(\)/.is::<Document>()/g s/\.is_htmlanchorelement\(\)/.is::<HTMLAnchorElement>()/g s/\.is_htmlappletelement\(\)/.is::<HTMLAppletElement>()/g s/\.is_htmlareaelement\(\)/.is::<HTMLAreaElement>()/g s/\.is_htmlbodyelement\(\)/.is::<HTMLBodyElement>()/g s/\.is_htmlembedelement\(\)/.is::<HTMLEmbedElement>()/g s/\.is_htmlfieldsetelement\(\)/.is::<HTMLFieldSetElement>()/g s/\.is_htmlformelement\(\)/.is::<HTMLFormElement>()/g s/\.is_htmlframesetelement\(\)/.is::<HTMLFrameSetElement>()/g s/\.is_htmlhtmlelement\(\)/.is::<HTMLHtmlElement>()/g s/\.is_htmlimageelement\(\)/.is::<HTMLImageElement>()/g s/\.is_htmllegendelement\(\)/.is::<HTMLLegendElement>()/g s/\.is_htmloptgroupelement\(\)/.is::<HTMLOptGroupElement>()/g s/\.is_htmloptionelement\(\)/.is::<HTMLOptionElement>()/g s/\.is_htmlscriptelement\(\)/.is::<HTMLScriptElement>()/g s/\.is_htmltabledatacellelement\(\)/.is::<HTMLTableDataCellElement>()/g s/\.is_htmltableheadercellelement\(\)/.is::<HTMLTableHeaderCellElement>()/g s/\.is_htmltablerowelement\(\)/.is::<HTMLTableRowElement>()/g s/\.is_htmltablesectionelement\(\)/.is::<HTMLTableSectionElement>()/g s/\.is_htmltitleelement\(\)/.is::<HTMLTitleElement>()/g
* / Remove unused JS::assign.Ms2ger2015-10-211-7/+0
|/
* Implement Deref<Target=T> for JS<T> where T: ReflectableAnthony Ramine2015-10-171-0/+10
| | | | | | | We can only borrow JS<T> from rooted things, so it's safe to deref it. The only types that provide mutable JS<T> things are MutHeap<JS<T>> and MutNullableHeap<JS<T>>, which don't actually expose that they contain JS<T> values.
* Fix documentation for JS<T> and friends.Eli Friedman2015-10-151-13/+18
|
* Fix remaining MutHeap methods not to expose JS<T>.Eli Friedman2015-10-151-12/+14
|
* Make get() and set() on MutNullableHeap use the correct types.Eli Friedman2015-10-151-14/+17
| | | | | | 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>.
* Stop implementing Copy for JS<T>.Eli Friedman2015-10-151-24/+36
| | | | | 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.
* Update script to work with lint changesManish Goregaokar2015-10-161-0/+4
|
* sorted the extern crate, mod & use declarationsRavi Shankar2015-09-241-2/+2
|
* Fix reported test-tidy errors for unmerged import blocksBrandon Fairchild2015-09-191-3/+2
| | | | This merges import blocks that were reported by tidy as unmerged.
* Stop implementing Reflectable for JS<T> (fixes #2285).Ms2ger2015-09-131-7/+6
| | | | It's not generally safe to expose the contents of a JS<T>.
* Elide most 'a lifetimesManish Goregaokar2015-09-041-7/+7
|
* Auto merge of #7361 - jxs:master, r=Ms2gerbors-servo2015-08-271-0/+1
|\ | | | | | | | | | | | | | | | | | | make dom_struct derive HeapSizeOf closes #7357 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7361) <!-- Reviewable:end -->
| * make dom_struct derive HeapSizeOf,João Oliveira2015-08-271-0/+1
| | | | | | | | closes #7357
* | Remove get_unsound_ref_forever functionJoão Oliveira2015-08-271-5/+0
|/ | | | closes #7383
* Fix existing syntactics nits.Josh Matthews2015-08-161-5/+5
|
* Replace uses of `for foo in bar.iter()` and `for foo in bar.iter_mut()`João Oliveira2015-08-151-1/+1
| | | | closes #7197
* Measure heap memory usage for more types. Fixes #6951Bogdan Cuza2015-08-131-1/+0
|
* Start reporting memory usage for Window and all nodes in all DOM trees for ↵Josh Matthews2015-08-031-1/+10
| | | | frame treese in script tasks.
* Make enum/fn part of unrooted_must_root handle type parametersManish Goregaokar2015-07-221-0/+1
|
* Fix rooting in scriptManish Goregaokar2015-07-221-0/+6
|
* Make stmt part of unrooted_must_root handle type parameters (fixes #6651)Manish Goregaokar2015-07-221-0/+1
|
* Refactor #[jstraceable] to #[derive(JSTraceable)]David Winslow2015-07-011-3/+3
| | | | fixes #6524
* Fix some warnings caused by the SM upgradeMichael Wu2015-06-191-1/+1
|
* Upgrade to SM 39Michael Wu2015-06-191-395/+148
|
* Upgrade to rustc 551a74dddd84cf01440ee84148ebd18bc68bd7c8.Simon Sapin2015-05-051-1/+0
|
* Add a Reflectable bound to Root's type parameter.Ms2ger2015-05-011-1/+1
|
* Implement Clone for Copy types.Ms2ger2015-04-281-0/+6
|
* Remove Temporary::new()Anthony Ramine2015-04-281-11/+8
| | | | Temporary::from_rooted() now takes an Assignable value.
* Remove unrooted() methodsAnthony Ramine2015-04-281-28/+5
|
* Remove the Comparable traitAnthony Ramine2015-04-281-22/+0
|
* Uniformise root() methodsAnthony Ramine2015-04-281-57/+33
| | | | | They now live in traits Rootable, OptionalOptionalRootable, OptionalRootable and ResultRootable.
* Make RootedVec/RootCollection #[no_move]; improve code (fixes #5737)Manish Goregaokar2015-04-281-0/+1
|
* Add the rust-tenacious move-protection lint, use it for `Root<T>` (fixes #5724)Manish Goregaokar2015-04-281-0/+1
|
* Change MutNullableJS<T> to MutNullableHeap<JS<T>>Anthony Ramine2015-04-271-46/+35
|
* Remove useless unsafe methods on LayoutJS<T>Anthony Ramine2015-04-261-8/+0
|
* Remove useless unsafe methods on JS<T>Anthony Ramine2015-04-261-26/+0
|
* Auto merge of #5550 - aneeshusa:fix-issue-5540, r=jdmbors-servo2015-04-071-1/+1
|\ | | | | | | | | | | Fixes issue #5540. As far as I can tell this is all that's necessary, but I'm new to Rust, so let me know if I missed something!
| * Don't consume self when calling root on a Temporary<T>.Aneesh Agrawal2015-04-061-1/+1
| | | | | | | | Fixes issue #5540.
* | RootCollection: Start using RootedVec instead of SmallVec32.Jag Talon2015-04-061-5/+9
|/ | | | | | | | | | | | dom/bindings/js.rs: Alphabetize `use`. dom/bindings/js.rs: moved `unsafe` block to a let binding. dom/bindings/trace.rs: rename alternate constructor of RootedVec. dom/bindings/trace.rs: `new()` is now using `new_with_destination_address()` internally. dom/bindings/js.rs: alphabetize imports.
* auto merge of #5425 : pcwalton/servo/optimize-rooting, r=Ms2gerbors-servo2015-04-021-9/+12
|\ | | | | | | | | | | This was showing up very high in instruction-level profiling. r? @jdm
| * script: Optimize JS rooting to not move the entire `Root` struct fromPatrick Walton2015-04-021-9/+12
| | | | | | | | | | | | the stack to the return out-pointer. This was showing up very high in instruction-level profiling.
* | Use a larger small vector.Ms2ger2015-04-021-3/+3
|/