aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/uievent.rs
Commit message (Collapse)AuthorAgeFilesLines
* Use new stylo crate renames (#35898)Nico Burns2025-03-121-1/+1
| | | Signed-off-by: Nico Burns <nico@nicoburns.com>
* script: Limit public exports. (#34915)Josh Matthews2025-01-101-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * script: Restrict reexport visibility of DOM types. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Mass pub->pub(crate) conversion. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Hide existing dead code warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix unit tests. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * More formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Expose node helpers as `NodeTraits` and give more descriptive names ↵Martin Robinson2025-01-031-2/+2
| | | | | | | | | | | | | (#34832) This puts a few commonly used `Node` helpers into a trait (`NodeTraits`) and gives them more descriptive names and documentation. The renames: - `document_from_node` -> `NodeTraits::owner_document` - `window_from_node` -> `NodeTraits::owner_window` - `stylesheets_owner_from_node<T:` -> `NodeTraits::stylesheet_list_owner` - `containing_shadow_root` -> `NodeTraits::containing_shadow_root` Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* retire deprecated MouseEvent::InitMouseEvent (#34538)Jay Wang2024-12-091-0/+4
| | | | Signed-off-by: Jay Wang <xdddxyyyxzzz123@gmail.com> Co-authored-by: Ngo Iok Ui (Wu Yu Wei) <yuweiwu@pm.me>
* script: add `initialize_ui_event` method (#34524)Jay Wang2024-12-081-5/+33
| | | | | | | | | | | | | | | | | | | | | | | | | * retire UIEvent::InitUIEvent Signed-off-by: Jay Wang <xdddxyyyxzzz123@gmail.com> * fix fmt Signed-off-by: Jay Wang <xdddxyyyxzzz123@gmail.com> * remove unused changes Signed-off-by: Jay Wang <xdddxyyyxzzz123@gmail.com> * reimplement the spec and reuse wherever we can Signed-off-by: Jay Wang <xdddxyyyxzzz123@gmail.com> * fix lint Signed-off-by: Jay Wang <xdddxyyyxzzz123@gmail.com> --------- Signed-off-by: Jay Wang <xdddxyyyxzzz123@gmail.com>
* Generate a trait abstracting over all known DOM interfaces (#34357)Josh Matthews2024-11-241-1/+1
| | | | | | | | | | | | | | | | | * script: Generate trait for all DOM interfaces and parameterize generated Methods traits over it. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Update trait implementations with new generic type. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* CanGc fixes and checks in multiple files (#33836)chickenleaf2024-10-151-10/+4
| | | | | | | | | | | | | * CanGc fixes and checks in multiple files Signed-off-by: L Ashwin B <lashwinib@gmail.com> * CanGc fixes in storageevent.rs Signed-off-by: L Ashwin B <lashwinib@gmail.com> --------- Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* script: Include constructors and static methods in generated DOM traits (#33665)Josh Matthews2024-10-081-4/+4
| | | | | | | | | | | | | | | | | * Add all constructors, special operations, and static methods to generated DOM interface traits. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Move all constructors and static methods defined in bare impl blocks inside FooMethods trait impls. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Add missing doc links. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Permitted functions to have too many arguments in components/script/dom (#33632)komuhangi2024-10-031-0/+1
| | | Signed-off-by: jahielkomu <ktumuhairwe24@gmail.com>
* Start marking functions that can transitively trigger a GC (#33144)Josh Matthews2024-08-221-4/+18
| | | | | | | | | | | | | | | | | * Mark JS reflector wrappers as CanGc. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Propagate CanGc from reflect_dom_object_with_proto. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Mark DOM constructors as GC operations. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-5/+7
| | | | | * strict imports formatting * Reformat all imports
* Rename reflect_dom_object2.Josh Matthews2023-05-311-2/+2
|
* Formatting.Josh Matthews2023-05-281-1/+4
|
* Support arbitrary protos when wrapping DOM objects with constructors.Josh Matthews2023-05-281-4/+23
|
* Add trait DomObjectWrap to provide WRAP functionYUAN LYU2020-03-201-5/+1
|
* Modify `script` to prevent further violations of snake_caseKunal Mohan2020-01-181-0/+1
|
* Upgrade to rustc 1.38.0-nightly (dddb7fca0 2019-07-30)Simon Sapin2019-07-311-1/+1
|
* Remove most RootedReference usesAnthony Ramine2019-03-101-2/+2
| | | | We can replace all uses of RootedReference for Option<T> by Option::deref calls.
* Update MPL license to https (part 3)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* `cargo fix --edition`Simon Sapin2018-11-061-10/+10
|
* Format script componentchansuke2018-09-191-24/+42
|
* 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-5/+5
| | | | | | | 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 MutNullableJS<T> to MutNullableDom<T>Anthony Ramine2017-09-261-2/+2
|
* Rename dom::bindings::js to dom::bindings::rootAnthony Ramine2017-09-261-1/+1
|
* Make #[dom_struct] a proc_macro attributeAnthony Ramine2017-02-241-0/+1
|
* Remove HeapGCValueAnthony Ramine2016-12-121-3/+2
| | | | | | 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.
* Make WebIDL constructors take a more specific global if possible (fixes #14071)Rohan Prinja2016-11-301-3/+2
|
* Update to string-cache 0.3Simon Sapin2016-11-031-1/+1
|
* Pass a &GlobalScope to WebIDL static methods and constructorsAnthony Ramine2016-10-061-3/+3
|
* Introduce GlobalScope::as_windowAnthony Ramine2016-10-061-1/+2
|
* Make reflect_dom_object take a &GlobalScopeAnthony Ramine2016-10-061-1/+1
|
* Reorder `use` statementsUK9922016-09-091-1/+1
|
* Fix all the links to the UI Events specAnthony Ramine2016-06-041-1/+1
| | | | DOM3Events is no more.
* Move DOMString back to scriptAnthony Ramine2016-05-241-1/+1
| | | | This entirely removes the 'non-geckolib' feature of the util crate.
* implement and use From<bool> for enum and backAlexander Popiak2016-03-171-8/+3
| | | | | implement and use From<bool> for EventBubbles (and back direction) implement and use From<bool> for EventCancelable (and back direction)
* Implement From<DOMString> for AtomAnthony Ramine2016-02-241-1/+1
|
* Make Event's isTrusted attribute unforgeableJohn DeSilva2015-12-131-0/+6
|
* Remove unused imports.Ms2ger2015-12-121-1/+0
|
* Pass around event types as Atoms instead of StringsCorey Farwell2015-12-101-1/+2
| | | | | | `Event` internally stores the `type` as an `Atom`, and we're `String`s everywhere, which can cause unnecessary allocations to occur since they'll end up as `Atom`s anyways.
* Get rid of a bunch of explicit derefsDavid Zbarsky2015-11-031-2/+2
|
* rearrange imports to be in alphabetical orderrohan.prinja2015-10-301-1/+1
|
* more refactoringrohan.prinja2015-10-301-1/+1
|
* move Castable into dom::bindings::inheritancerohan.prinja2015-10-301-1/+1
|
* remove get_rooted() and replace all references to it with references to get()rohan.prinja2015-10-291-1/+1
|
* Clean up the cast callsAnthony Ramine2015-10-211-1/+1
|
* Introduce trait CastableAnthony Ramine2015-10-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Make get() and set() on MutNullableHeap use the correct types.Eli Friedman2015-10-151-1/+1
| | | | | | 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>.
* Generate all Derived implementations in codegenAnthony Ramine2015-10-141-10/+1
|
* Generate the TypeId enums in codegenAnthony Ramine2015-10-141-12/+5
|