aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/range.rs
Commit message (Collapse)AuthorAgeFilesLines
* Replace all uses of the `heapsize` crate with `malloc_size_of`.Nicholas Nethercote2017-10-181-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`. `malloc_size_of` is better -- it handles various cases that `heapsize` does not -- so this patch changes Servo to use `malloc_size_of`. This patch makes the following changes to the `malloc_size_of` crate. - Adds `MallocSizeOf` trait implementations for numerous types, some built-in (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`). - Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't support that operation. - For `HashSet`/`HashMap`, falls back to a computed estimate when `enclosing_size_of_op` isn't available. - Adds an extern "C" `malloc_size_of` function that does the actual heap measurement; this is based on the same functions from the `heapsize` crate. This patch makes the following changes elsewhere. - Converts all the uses of `heapsize` to instead use `malloc_size_of`. - Disables the "heapsize"/"heap_size" feature for the external crates that provide it. - Removes the `HeapSizeOf` implementation from `hashglobe`. - Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of` doesn't derive those types, unlike `heapsize`.
* Fix commonmark Markdown warnings in docs, part 1Matt Brubeck2017-10-171-8/+8
| | | | | | | | Fixes warnings from rust-lang/rust#44229 when `--enable-commonmark` is passed to rustdoc. This is mostly a global find-and-replace for bare URIs on lines by themselves in doc comments.
* Remove use of unstable box syntax.Simon Sapin2017-10-161-4/+7
| | | | | | | | | | | | | | | | | | | | http://www.robohornet.org gives a score of 101.36 on master, and 102.68 with this PR. The latter is slightly better, but probably within noise level. So it looks like this PR does not affect DOM performance. This is expected since `Box::new` is defined as: ```rust impl<T> Box<T> { #[inline(always)] pub fn new(x: T) -> Box<T> { box x } } ``` With inlining, it should compile to the same as box syntax.
* Rename Root<T> to DomRoot<T>Anthony Ramine2017-09-261-25/+25
| | | | | | | In a later PR, DomRoot<T> will become a type alias of Root<Dom<T>>, where Root<T> will be able to handle all the things that need to be rooted that have a stable traceable address that doesn't move for the whole lifetime of the root. Stay tuned.
* Rename MutJS<T> to MutDom<T>Anthony Ramine2017-09-261-3/+3
|
* Rename JS<T> to Dom<T>Anthony Ramine2017-09-261-2/+2
|
* Rename dom::bindings::js to dom::bindings::rootAnthony Ramine2017-09-261-1/+1
|
* Upgrade to rustc 1.21.0-nightly (13d94d5fa 2017-08-10)Simon Sapin2017-08-151-2/+2
|
* Untry scriptSimon Sapin2017-06-181-42/+42
|
* Remove obsolete step from Text::SplitTextAnthony Ramine2017-03-071-6/+0
| | | | https://github.com/whatwg/dom/pull/419
* Make #[dom_struct] a proc_macro attributeAnthony Ramine2017-02-241-0/+1
|
* Change #[privatize] into #[derive(DenyPublicFields)]Anthony Ramine2017-02-151-3/+1
|
* Remove HeapGCValueAnthony Ramine2016-12-121-3/+3
| | | | | | It could be used to have mutable JSVal fields without GC barriers. With the removal of that trait, MutHeap and MutNullableHeap can respectively be replaced by MutJS and MutNullableJS.
* Mark JSTraceable and its method as unsafeAnthony Ramine2016-12-061-3/+3
|
* Refactor fragment parsingAnthony Ramine2016-12-011-10/+2
|
* Make WebIDL constructors take a more specific global if possible (fixes #14071)Rohan Prinja2016-11-301-3/+3
|
* Add missing actions in CreateContextualFragment methodGuillaume Gomez2016-11-181-2/+3
|
* Update to string-cache 0.3Simon Sapin2016-11-031-2/+2
|
* Remove intrinsic Root::r()Anthony Ramine2016-10-111-45/+45
|
* Pass a &GlobalScope to WebIDL static methods and constructorsAnthony Ramine2016-10-061-3/+3
|
* Introduce GlobalScope::as_windowAnthony Ramine2016-10-061-1/+1
|
* Make reflect_dom_object take a &GlobalScopeAnthony Ramine2016-10-061-1/+1
|
* Reorder `use` statementsUK9922016-09-091-2/+2
|
* Use a stack guard and a macro for RootedVec instead of return_address.Eduard Burtescu2016-07-041-2/+2
|
* Implement Range::createContextualFragmentGuillaume Gomez2016-06-031-0/+41
|
* Move DOMString back to scriptAnthony Ramine2016-05-241-1/+1
| | | | This entirely removes the 'non-geckolib' feature of the util crate.
* Implement Stringifier for RangeKeith Yeung2016-03-091-1/+44
|
* Auto merge of #9799 - nox:range-extractcontents, r=KiChjangbors-servo2016-02-291-2/+3
|\ | | | | | | | | | | | | | | | | | | | | Fix step 14.2 of Range::ExtractContents We need the last inclusive ancestor of start node that is not an inclusive ancestor of end node, not the first that is an inclusive ancestor of it. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9799) <!-- Reviewable:end -->
| * Fix step 14.2 of Range::ExtractContentsAnthony Ramine2016-02-291-2/+3
| | | | | | | | | | We need the last inclusive ancestor of start node that is not an inclusive ancestor of end node, not the first that is an inclusive ancestor of it.
* | Auto merge of #9797 - nox:range-insertnode, r=KiChjangbors-servo2016-02-291-0/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix step 1 of Range::InsertNode The method needs to throw when trying to insert start node into range. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9797) <!-- Reviewable:end -->
| * | Fix step 1 of Range::InsertNodeAnthony Ramine2016-02-281-0/+3
| |/ | | | | | | The method needs to throw when trying to insert start node into range.
* / script: Fix remaining bugs from Range.deleteContentsEmilio Cobos Álvarez2016-02-281-11/+17
|/
* Fix step 6 of Range::DeleteContentsAnthony Ramine2016-02-281-1/+1
|
* Say farewell to in-tree HeapSizeOfAnthony Ramine2016-02-041-1/+1
|
* Properly propagate changes when range or trees are mutatedAnthony Ramine2015-12-251-26/+312
|
* Introduce CharacterData::clone_with_data()Anthony Ramine2015-12-131-18/+12
|
* Fix the spec links for DOM rangesAnthony Ramine2015-12-131-12/+12
|
* Add XMLDocument objectGuillaume Gomez2015-11-271-1/+1
|
* Implement Range#deleteContentsDavid Zbarsky2015-11-251-0/+75
|
* Use DOMString::new() somewhat consistently.Ms2ger2015-11-041-3/+4
|
* Get rid of a bunch of explicit derefsDavid Zbarsky2015-11-031-2/+2
|
* merge from masterrohan.prinja2015-11-031-1/+1
|\
| * Fix some rust-clippy violationsCorey Farwell2015-10-301-1/+1
| |
* | rearrange imports to be in alphabetical orderrohan.prinja2015-10-301-2/+2
| |
* | replace InheritTypes imports with inheritance importsrohan.prinja2015-10-301-1/+1
| |
* | more refactoringrohan.prinja2015-10-301-1/+1
| |
* | move Castable into dom::bindings::inheritancerohan.prinja2015-10-301-1/+1
|/
* Remove Rc<T> usage from RangeAnthony Ramine2015-10-231-237/+134
| | | | | | I initially used this to correctly handle ranges when their respective containers are mutated, to get weak references of Range objects. I now realise that the weak references should be handled at a lower-level, closer to the JS-managed object.
* Clean up the cast callsAnthony Ramine2015-10-211-18/+18
|
* Introduce trait CastableAnthony Ramine2015-10-211-37/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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