aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlcollection.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* Move DOMString back to scriptAnthony Ramine2016-05-241-1/+2
| | | | This entirely removes the 'non-geckolib' feature of the util crate.
* Move '&&' to the end of the previous line.Zbynek Winkler2016-04-221-2/+2
| | | | | | Following https://github.com/servo/servo/issues/10692 this is just a formating change to satisfy a new tidy requirement of not having '&&' at the beginning of a line.
* Remove `get_*` on getters as per RFC 0344.Corey Farwell2016-03-311-2/+2
| | | | | | https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md#gettersetter-apis https://github.com/servo/servo/issues/6224
* Remove HTMLCollectionElementsRevIterKeith Yeung2016-03-191-25/+6
|
* Implement From<DOMString> for AtomAnthony Ramine2016-02-241-3/+3
|
* Inline functions HTMLCollection::get_length and get_itemSaurav Sachidanand2016-02-241-48/+40
|
* Fix HTMLCollection::NamedItemAnthony Ramine2016-02-231-2/+2
|
* Implement HTMLFormElement::ElementsCorey Farwell2016-01-101-1/+1
| | | | Fixes #8566
* Fix a bunch of clippy lintsJohannes Linke2016-01-021-4/+4
|
* Update string_cache to 0.2.Alan Jeffrey2015-11-251-5/+5
| | | | | | | | | | | Updated string_cache, html5ever, xml5ever and selectors in Cargo.toml files and Cargo.lock. Removed references to string_cache_plugin. Import atom! and ns! from string_cache. Replaced ns!("") by ns!(). Replaced ns!(XML) and co by ns!(xml) and co. Replaced atom!(foo) by atom!("foo"). Replaced Atom::from_slice by Atom::from. Replaced atom.as_slice() by &*atom.
* Caching HTMCollections.Alan Jeffrey2015-11-061-65/+187
| | | | | | | | | | | | | | | | | | We cache the state of any live HTMLCollection, keeping track of a) the optional cached length of the collection, and b) an optional cursor into the collection (a node in the collection plus its index). The cache is invalidated based on the version number of the node. We use these caches for speeding up random access to the collection. When returning coll[i], we search from the cursor, if it exists, and otherwise search from the front of the collection. In particular, both a forward for-loop and a backward for-loop through the collection will now have each access take O(1) time rather than O(n) time. This gets 1000x speed-up on the relevant Dromaeo DOM query tests.
* Get rid of a bunch of explicit derefsDavid Zbarsky2015-11-031-2/+2
|
* merge from masterrohan.prinja2015-11-031-1/+1
|\
| * Removed JS::root Fixes #8251nxnfufunezn2015-10-311-1/+1
| |
* | rearrange imports to be in alphabetical orderrohan.prinja2015-10-301-2/+2
| |
* | more refactoringrohan.prinja2015-10-301-1/+2
| |
* | move Castable into dom::bindings::inheritancerohan.prinja2015-10-301-1/+1
|/
* Don't allow unrooted values in function arguments.Eli Friedman2015-10-231-0/+2
|
* Clean up the cast callsAnthony Ramine2015-10-211-3/+3
|
* Introduce trait CastableAnthony Ramine2015-10-211-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Implement deleteRow and insertRow for <table> elementCorey Farwell2015-10-111-2/+2
| | | | Continued from #6936
* sorted the extern crate, mod & use declarationsRavi Shankar2015-09-241-1/+1
|
* Fix reported test-tidy errors for unmerged import blocksBrandon Fairchild2015-09-191-2/+1
| | | | This merges import blocks that were reported by tidy as unmerged.
* Auto merge of #7452 - nox:cleanup-attributes, r=noxbors-servo2015-09-021-3/+6
|\ | | | | | | | | | | | | | | | | | | Introduce VirtualMethods::attribute_mutated() <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7452) <!-- Reviewable:end -->
| * Replace many uses of to_ascii_lowercase() by make_ascii_lowercase()Anthony Ramine2015-08-301-3/+6
| |
* | Make test-tidy check that braces have spaces before or after themwilmoz2015-08-311-1/+1
|/
* Merge adjacent identical `impl` sectionsCorey Farwell2015-08-281-2/+0
| | | | | Prior to #7416 and #7401, many of these `impl` sections were not identical
* Make the traits for the IDL interfaces take &selfAnthony Ramine2015-08-271-7/+7
|
* Remove AttributeHandlersAnthony Ramine2015-08-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | On components/script/*.rs: # Remove imports. /^ *use dom::element::\{.*AttributeHandlers/ { s/\{AttributeHandlers, /\{/ s/, AttributeHandlers//g s/\{([a-zA-Z]+)\}/\1/ /\{\}/d s/::self;$/;/ } /^ *use dom::element::\{?AttributeHandlers\}?;$/d # Remove AttributeHandlers. /^pub trait AttributeHandlers \{$/,/^\}$/D # Patch AttributeHandlers methods. /^impl<'a> AttributeHandlers for &'a Element \{/,/^\}$/ { s/^impl<'a> AttributeHandlers for &'a Element \{/impl Element {/ /^ *fn /s/\(self([,)])/\(\&self\1/ /^ *fn.*\(&self/s/fn/pub fn/ } The few error cases were then fixed by hand.
* Remove helper traitsAnthony Ramine2015-08-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* make dom_struct derive HeapSizeOf,João Oliveira2015-08-271-1/+0
| | | | closes #7357
* Cleanup Element iteration in dom/htmlcollection.rsCorey Farwell2015-08-201-31/+35
|
* Work around uses of #[allow(unrooted_must_root)]Corey Farwell2015-08-201-10/+7
| | | | | Using this directive could cause rooting errors to be silently ignored, so we should avoid it as much as possible
* Initial implementation of ownPropertyKeys proxy handlerCorey Farwell2015-08-201-1/+26
| | | | | | | | | | | Generates `SupportedPropertyNames` on DOM structs that should implement it. Most of them are unimplemented now (which can be implemented in later PRs), with the exception of `HTMLCollection`. Also added a couple relevant WPT tests. Closes #6390 Closes #2215
* turn enum into structvectorijk2015-08-161-33/+25
| | | | pub enum CollectionTypeId -> pub struct Collection
* remove unused static collectionvectorijk2015-08-161-10/+1
|
* Fix existing syntactics nits.Josh Matthews2015-08-161-2/+2
|
* Measure heap memory usage for more types. Fixes #6951Bogdan Cuza2015-08-131-5/+7
|
* Add spec linksBogdan Cuza2015-07-281-0/+2
|
* Auto merge of #6529 - dwins:master, r=Manishearthbors-servo2015-07-011-6/+6
|\ | | | | | | | | | | | | | | | | | | Refactor #[jstraceable] to #[derive(JSTraceable)] fixes #6524. I had to make an additional change not mentioned in the ticket - adding the `#[feature]` to enable deriving custom traits but I assume that's expected at this time. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6529) <!-- Reviewable:end -->
| * Refactor #[jstraceable] to #[derive(JSTraceable)]David Winslow2015-07-011-6/+6
| | | | | | | | fixes #6524
* | Remove string_cache dependency from util.Matt Brubeck2015-07-011-3/+2
|/ | | | | Move `namespace::from_domstring` from util to script::dom, because it is used only in that crate.
* Upgrade to SM 39Michael Wu2015-06-191-38/+34
|
* Upgrade to rustc 551a74dddd84cf01440ee84148ebd18bc68bd7c8.Simon Sapin2015-05-051-2/+4
|
* Remove Temporary::new()Anthony Ramine2015-04-281-1/+1
| | | | Temporary::from_rooted() now takes an Assignable value.
* Uniformise root() methodsAnthony Ramine2015-04-281-1/+1
| | | | | They now live in traits Rootable, OptionalOptionalRootable, OptionalRootable and ResultRootable.
* Remove as_slice() calls from script.Ms2ger2015-04-261-1/+0
|
* Update WHATWG links to use HTTPSCorey Farwell2015-04-131-3/+3
| | | | | | | | | | | | | | Extracted this out of #5649 This commit was created with the following commands: ``` find . -iname "*.webidl" -type f -print0 | xargs -0 sed -i '' 's/http:\(.*\)whatwg.org/https:\1whatwg.org/g' ``` ``` find . -iname "*.rs" -type f -print0 | xargs -0 sed -i '' 's/http:\(.*\)whatwg.org/https:\1whatwg.org/g' ```
* Use a simple Temporary value in TreeIteratorAnthony Ramine2015-04-131-12/+12
|
* Remove some unnecessary uses of `as_slice`Corey Farwell2015-03-291-7/+7
| | | | | | | | | | | For the majority of these cases, `as_slice` can be removed due to `Deref`. In particular, `Deref` for: * `String` -> `str` * `Atom` -> `str` The latter of those two requires, a bump of the locked `string-cache` library