aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/domimplementation.rs
Commit message (Collapse)AuthorAgeFilesLines
* Remove use of unstable box syntax.Simon Sapin2017-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | 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-8/+8
| | | | | | | 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 JS<T> to Dom<T>Anthony Ramine2017-09-261-3/+3
|
* Rename dom::bindings::js to dom::bindings::rootAnthony Ramine2017-09-261-1/+1
|
* Support `is` option when creating elementsConnor Brewster2017-06-231-2/+3
|
* Untry scriptSimon Sapin2017-06-181-1/+1
|
* Make #[dom_struct] a proc_macro attributeAnthony Ramine2017-02-241-0/+1
|
* Add ImmutableOrigin to allow for serializing originsConnor Brewster2017-02-221-2/+2
|
* Allow windows to share browsing contexts.Alan Jeffrey2017-01-281-3/+3
|
* The constellation notifies the script thread about documents becoming ↵Alan Jeffrey2017-01-271-0/+3
| | | | inactive, active and fully active.
* Auto merge of #14647 - servo:current-global, r=jdmbors-servo2016-12-291-0/+2
|\ | | | | | | | | | | | | | | Support the 'current' global object. <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14647) <!-- Reviewable:end -->
| * Pass the Document's origin to its constructor.Ms2ger2016-12-231-0/+2
| | | | | | | | CC #10963.
* | script: Simplify DOMImplementation::CreateHTMLDocument.Emilio Cobos Álvarez2016-12-251-14/+11
|/
* Update to string-cache 0.3Simon Sapin2016-11-031-4/+4
|
* Remove intrinsic Root::r()Anthony Ramine2016-10-111-6/+6
|
* Make reflect_dom_object take a &GlobalScopeAnthony Ramine2016-10-061-2/+1
|
* Reorder `use` statementsUK9922016-09-091-2/+2
|
* script: Obtain referrer policy from headerAravind Gollakota2016-07-151-0/+1
|
* Implement Document.referrerNazım Can Altınova2016-07-141-1/+2
|
* Move DOMString back to scriptAnthony Ramine2016-05-241-1/+1
| | | | This entirely removes the 'non-geckolib' feature of the util crate.
* [10743] Add content type to XmlDocument constructor based on namespacecjkenned2016-04-281-4/+11
| | | | | | | | | | | | | | | | | | | | [10743] Fix namespace in createDocument test [10743] Remove test ini file, match returns static strings instead of DOMString. [10743] Fix arguments to XMLDocument::new Update failing test [10743] Add content type to XmlDocument constructor based on namespace [10743] Fix namespace in createDocument test [10743] Remove test ini file, match returns static strings instead of DOMString. [10743] Fix arguments to XMLDocument::new Update failing test
* Make it possible for XMLDocuments to have a browsing context.Josh Matthews2016-02-201-0/+1
|
* Store a pointer to the browsing context in the Document.Ms2ger2016-02-111-0/+1
|
* Remove unnecessary conversion to/from DOMString for localName.Eli Friedman2015-12-021-4/+4
|
* Add XMLDocument objectGuillaume Gomez2015-11-271-9/+10
|
* Rustfmt some of script.Ms2ger2015-11-181-14/+34
|
* Replaced DOMString constructor by conversion functions.Alan Jeffrey2015-11-121-6/+5
| | | | | | Replaced DOMString(...) by DOMString::from(...). Replaced ....0 by String::from(...). Removed any uses of .to_owner() in DOMString::from("...").
* Make DOMString a newtype around String, rather than a typedef.Ms2ger2015-11-041-5/+5
| | | | | | | | | | This should make it somewhat easier to experiment with alternative representations in the future. To reduce churn, this commit leaves the String field public, though. Also, this will allow us to use the default String type to represent the IDL USVString type, which explicitly forbids unpaired surrogates, ans as such is a better match to the Rust String type.
* Get rid of a bunch of explicit derefsDavid Zbarsky2015-11-031-1/+1
|
* more refactoringrohan.prinja2015-10-301-2/+2
|
* move Castable into dom::bindings::inheritancerohan.prinja2015-10-301-1/+1
|
* Clean up the cast callsAnthony Ramine2015-10-211-17/+10
|
* Introduce trait CastableAnthony Ramine2015-10-211-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Do not root DOMImplementation::documentAnthony Ramine2015-10-191-10/+5
|
* Return a reference in Document::window()Anthony Ramine2015-10-191-3/+3
|
* 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.
* Make the traits for the IDL interfaces take &selfAnthony Ramine2015-08-271-5/+5
|
* Remove helper traitsAnthony Ramine2015-08-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* sort all usesJohann Tuffe2015-08-201-3/+3
|
* Measure heap memory usage for more types. Fixes #6951Bogdan Cuza2015-08-131-0/+1
|
* Upgrade to SM 39Michael Wu2015-06-191-30/+29
|
* Reduce max line length from 150 to 120 charactersCorey Farwell2015-05-241-3/+6
| | | | Part of https://github.com/servo/servo/issues/6041
* Implement a DocumentLoader type that tracks pending loads and notifies the ↵Josh Matthews2015-05-111-4/+9
| | | | script task when the queue is empty. Dispatch the document load event based on the DocumentLoader's notification.
* Auto merge of #5871 - nox:rootable, r=jdmbors-servo2015-04-281-1/+2
|\ | | | | | | | | | | <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5871) <!-- Reviewable:end -->
| * Uniformise root() methodsAnthony Ramine2015-04-281-1/+2
| | | | | | | | | | They now live in traits Rootable, OptionalOptionalRootable, OptionalRootable and ResultRootable.
* | Auto merge of #5874 - nox:hasfeature, r=Ms2gerbors-servo2015-04-281-1/+1
|\ \ | |/ |/| | | | | | | <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5874) <!-- Reviewable:end -->
| * Fix DOMImplementation.hasFeature()Anthony Ramine2015-04-271-1/+1
| |
* | Fix some no_move errorsManish Goregaokar2015-04-281-1/+1
|/
* Add/update comments with links to specCorey Farwell2015-04-141-0/+1
| | | | | | | | | | Extracted out of #5649 * add more hyperlinks to associated specification for structs/methods * follow redirects and update links * replace broken links * removal of WHATWG multipage page name since the page name is not guaranteed to be stable