aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlscriptelement.rs
Commit message (Collapse)AuthorAgeFilesLines
* sorted the extern crate, mod & use declarationsRavi Shankar2015-09-241-5/+5
|
* Fix reported test-tidy errors for unmerged import blocksBrandon Fairchild2015-09-191-8/+6
| | | | This merges import blocks that were reported by tidy as unmerged.
* Use static atoms in some places.Ms2ger2015-09-141-3/+2
|
* Auto merge of #7452 - nox:cleanup-attributes, r=noxbors-servo2015-09-021-24/+34
|\ | | | | | | | | | | | | | | | | | | 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 -->
| * Introduce VirtualMethods::attribute_mutated()Anthony Ramine2015-09-021-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces before_remove_attr(), after_remove_attr() and after_set_attr(). The virtual method takes the mutated attribute and an AttributeMutation value to disambiguate between "attribute is changed", "attribute is added" and "attribute is removed". In the case of "attribute is changed", the mutation value contains a reference to the old value of the mutated attribute, which is used to unregister outdated named elements when the "id" attribute is changed on an element. This greatly simplifies the handling of attributes, which in many cases don't have any specific behaviour whether they are removed or changed or added. It also fixes a few bugs where things were put in before_remove_attr() instead of after_remove_attr() (e.g. when removing an href attribute from a base element). A few helper functions in Element were also renamed and made private.
| * Replace many uses of Attr::Value() by Attr::value()Anthony Ramine2015-08-301-16/+20
| | | | | | | | The later only borrows the attribute, without copying its value as a string.
| * Replace many uses of to_ascii_lowercase() by make_ascii_lowercase()Anthony Ramine2015-08-301-1/+3
| |
* | Enforce linking to spec for method implementations via macrosCorey Farwell2015-08-311-1/+2
|/
* Merge adjacent identical `impl` sectionsCorey Farwell2015-08-281-3/+0
| | | | | Prior to #7416 and #7401, many of these `impl` sections were not identical
* Time distribution across script event categories.benshu2015-08-281-2/+3
|
* Make the traits for the IDL interfaces take &selfAnthony Ramine2015-08-271-3/+3
|
* Remove AttributeHandlersAnthony Ramine2015-08-271-2/+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-53/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove doublepointer in VirtualMethods, and from_borrowed_refManish Goregaokar2015-08-271-4/+4
| | | | | | | | | Most of the heavy lifting done by: ``` $ ls *rs | xargs gawk -i inplace '/let .*: &&.*from_borrowed_ref/{sub("&&", "\\&");sub("_borrowed_","_");} {print $0}' $ ls *rs | xargs gawk -i inplace "/impl.*VirtualMethods/{in_vm=1; sub(/<'a>/,\"\");sub(/&'a /,\"\")} /^}\$/{in_vm=0;} in_vm{\$0=gensub(/\\*self([^.])/,\"self\\\1\",\"g\"); sub(/from_borrowed_ref/,\"from_ref\")} {print}" ```
* sort all usesJohann Tuffe2015-08-201-9/+9
|
* Auto merge of #7006 - Wafflespeanut:script_cleanup, r=jdmbors-servo2015-08-151-3/+3
|\ | | | | | | | | | | | | | | | | | | Splitting ScriptMsg into various enums... ... for #3734, which is also one of the oldest issues. (/cc @jdm) <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7006) <!-- Reviewable:end -->
| * Splitting ScriptMsg into various enums; r=jdmRavi Shankar2015-08-151-3/+3
| |
* | replace .len() == 0 with is_empty()João Oliveira2015-08-141-1/+1
|/ | | | closes #7198
* Measure heap memory usage for more types. Fixes #6951Bogdan Cuza2015-08-131-0/+3
|
* script: Make the resource task communication use IPC channels.Patrick Walton2015-07-311-6/+7
|
* net: Use a thread for each `AsyncResponseTarget` to avoid having to sendPatrick Walton2015-07-311-2/+10
| | | | trait objects across process boundaries.
* net: Make most of the resource task messages serializable.Patrick Walton2015-07-311-1/+1
|
* Introduce VirtualMethods::children_changed()Anthony Ramine2015-07-251-3/+4
| | | | | | | | | This virtual method mimics the behaviour of mutation observers and make it more viable than the older child_inserted(), which didn't cover removed nodes and was called as many times as there were inserted nodes. A few other shortcomings where remove_child() was called directly instead of Node::remove() were also fixed while at it.
* Upgrade to SM 39Michael Wu2015-06-191-43/+46
|
* Reduce max line length from 150 to 120 charactersCorey Farwell2015-05-241-2/+5
| | | | Part of https://github.com/servo/servo/issues/6041
* Update test expectations. Mark script loads as complete when the response is ↵Josh Matthews2015-05-211-2/+8
| | | | complete.
* Make external script sources load asynchronously, yet still block further ↵Josh Matthews2015-05-201-18/+83
| | | | parsing. Hook up document loading to async networking events.
* Implement a DocumentLoader type that tracks pending loads and notifies the ↵Josh Matthews2015-05-111-2/+5
| | | | script task when the queue is empty. Dispatch the document load event based on the DocumentLoader's notification.
* Uniformise root() methodsAnthony Ramine2015-04-281-1/+2
| | | | | They now live in traits Rootable, OptionalOptionalRootable, OptionalRootable and ResultRootable.
* Fix some no_move errorsManish Goregaokar2015-04-281-2/+2
|
* Remove as_slice() calls from script.Ms2ger2015-04-261-2/+2
|
* Don't link to specific WHATWG multipage pageCorey Farwell2015-04-161-6/+6
| | | | | | | | | | | | | | "Links to the multipage version of the specification are unfortunately likely to break over time." -- https://html.spec.whatwg.org/multipage/asefij.html This commit removes all references to the specific pages when viewing WHATWG using multipage mode. I went through all these links and they redirect fine. Regex used to generate this commit: `s_whatwg.org/multipage/.*#_whatwg.org/multipage/#_g`
* Update WHATWG links to use HTTPSCorey Farwell2015-04-131-4/+4
| | | | | | | | | | | | | | 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 Temporary iterator in Node::collect_text_contents()Anthony Ramine2015-04-071-2/+1
|
* Make Element::get_attribute() take its namespace by referenceAnthony Ramine2015-04-061-6/+6
|
* Split out shared networking code into net_traits crateGilles Leblanc2015-04-031-1/+1
| | | | Fixes #4476
* Rewrite NodeChildrenIterator to return Temporary.Ms2ger2015-04-021-1/+1
|
* Handle the for and event attributes on a script element correctly when one ↵Keith Yeung2015-04-011-13/+14
| | | | of them is present (fixes #5258).
* Use box syntax instead of Box::new()Brandon DeRosier2015-03-291-4/+4
| | | | Closes #5417
* Use new `if let` syntax wherever possible. Fixes #4153.Zack Slayton2015-03-101-12/+8
|
* auto merge of #5054 : psdh/servo/scriptimplementation, r=jdmbors-servo2015-03-061-9/+26
|\ | | | | | | Fixes #4089
| * implement missing steps from "prepare a script" algorithmPrabhjyot Singh Sodhi2015-03-061-9/+26
| | | | | | | | Fixes #4089
* | Move everything unrelated to the frame tree out of Page and into Document or ↵Josh Matthews2015-03-031-4/+3
|/ | | | Window. Reduce the API surface of Page to a bare minimum to allow for easier future removal.
* Implement Document.currentScriptJames Gilbertson2015-02-271-10/+9
|
* Implement 'beforescriptexecute' and 'afterscriptexecute' events.James Gilbertson2015-02-251-21/+52
| | | | Spec: https://html.spec.whatwg.org/multipage/scripting.html#execute-the-script-block, sections 2.b.2 & 2.b.9
* Split the 'Execute a script block' code out of prepare().Ms2ger2015-02-231-44/+128
| | | | | | | This also adds comments for missing steps. The only change in behaviour should be the debug message when an external script fails to load.
* Introduce dom::htmlscriptelement::EventDispatcher.Tetsuharu OHZEKI2015-02-231-10/+19
|
* Fixing Intermittent failure in pages with timersPrabhjyot Singh Sodhi2015-02-221-2/+2
| | | | Fixes #4923
* auto merge of #4939 : KiChjang/servo/script-element-error-events, r=jdmbors-servo2015-02-211-3/+37
|\ | | | | | | Fixes #4506