aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/activation.rs
Commit message (Collapse)AuthorAgeFilesLines
* script_layout: Remove script to layout messages (#32081)Martin Robinson2024-04-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Instead of communicating with layout via messages, script can simply call methods on the layout trait. This simplifies the way that script communicates with layout and opens the path to sharing more data structures between the two systems. This is part of a continuing series of cleanups after removing the layout thread. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes do not require tests because they should not change behavior. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-1/+2
| | | | | * strict imports formatting * Reformat all imports
* Event dispatch rewritten to resemble spec more often, activate on clicks betterPatrick Shaughnessy2020-02-121-83/+11
|
* [WIP] solve #22782takumi2019-10-181-3/+0
| | | | TODO: write tests for my change
* Implement MouseEvent buttons attributeGeorge Roman2019-05-161-0/+2
|
* Update MPL license to https (part 3)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* `cargo fix --edition`Simon Sapin2018-11-061-9/+9
|
* Format script componentchansuke2018-09-191-23/+27
|
* Use WebRender to compute text index on click eventsMartin Robinson2017-10-181-0/+1
| | | | | | This is the second half of switching over to WebRender for hit testing. Now that WebRender gives us the location of the hit tested point in the display item, we can use that to calculate text index.
* Combine ReflowGoal and ReflowQueryTypeMartin Robinson2017-09-301-8/+3
| | | | | This simplifies the logic in the layout_thread and makes it clearer which types of reflows generate display lists and cause display updates.
* Remove intrinsic Root::r()Anthony Ramine2016-10-111-2/+2
|
* One last refactoring before fixingArthur Marble2016-09-181-1/+1
|
* Refactored metaKey to meta_key where possibleArthur Marble2016-09-171-2/+2
|
* This commit refactors altKey to alt_key when possible.Arthur Marble2016-09-171-2/+2
|
* This commit refactors shiftKey to shift_key where possible.Arthur Marble2016-09-171-2/+2
|
* This commit refactors ctrlKey to ctrl_key wherever possible.Arthur Marble2016-09-171-2/+2
|
* Issue 8719: Add basic support for :active selectorSteve Melia2016-07-041-0/+22
|
* Move DOMString back to scriptAnthony Ramine2016-05-241-1/+1
| | | | This entirely removes the 'non-geckolib' feature of the util crate.
* Call synthetic_click_activation for all clicksRebecca2016-03-101-40/+55
| | | | | | | Moved synthetic_click_actiavtion out of Activatable trait so it can be called by all elements (not just activatable). Calls appropriately from click. Also updates the isdisabled check in click to check for all types of elements
* Rustfmt some of script.Ms2ger2015-11-181-5/+21
|
* Replaced DOMString constructor by conversion functions.Alan Jeffrey2015-11-121-2/+1
| | | | | | 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-1/+2
| | | | | | | | | | 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.
* move Castable into dom::bindings::inheritancerohan.prinja2015-10-301-1/+1
|
* Clean up the cast callsAnthony Ramine2015-10-211-1/+1
|
* 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
* Fix reported test-tidy errors for unmerged import blocksBrandon Fairchild2015-09-191-1/+0
| | | | This merges import blocks that were reported by tidy as unmerged.
* Elide most 'a lifetimesManish Goregaokar2015-09-041-1/+1
|
* 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.
* Upgrade to SM 39Michael Wu2015-06-191-11/+10
|
* Upgrade to rustc 551a74dddd84cf01440ee84148ebd18bc68bd7c8.Simon Sapin2015-05-051-1/+1
|
* Uniformise root() methodsAnthony Ramine2015-04-281-1/+1
| | | | | They now live in traits Rootable, OptionalOptionalRootable, OptionalRootable and ResultRootable.
* Don't link to specific WHATWG multipage pageCorey Farwell2015-04-161-4/+4
| | | | | | | | | | | | | | "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 some URLs.Ms2ger2015-04-141-2/+2
| | | | | The HTML spec's division into pages is not stable, so it is safer to use the URL without a specific page (which will redirect).
* 4873 - Support the image map processing for <img ismap/> inside an <a/>Shing Lyu2015-04-141-2/+2
|
* make MouseEvent::new() and UIEvent::new() take enums for the bubbles and ↵Rohan Prinja2015-03-151-2/+2
| | | | cancelable arguments
* Initialize trusted-ness of DOM events properlyGilles Leblanc2015-02-031-3/+2
| | | | Fixes #3740
* Specific instances of activatable elements may not be activatable (fixes #4765Manish Goregaokar2015-01-311-0/+3
|
* Move to to_owned rather than into_string.Ms2ger2015-01-201-1/+2
| | | | into_string has been removed from Rust.
* Replace Root::deref() calls by Root::r() calls where possible.Ms2ger2015-01-011-7/+8
| | | | This changes those calls that were already sound.
* script: to_string() -> into_string()Manish Goregaokar2014-12-271-1/+1
|
* Add auxiliary method to EventTargetHelpers for events without targetthiagopnts2014-12-161-1/+1
| | | | fixup! Add auxiliary method to EventTargetHelpers for events without target
* Implement implicit form submissionManish Goregaokar2014-12-051-0/+3
|
* Some reorganization of activation code:Manish Goregaokar2014-12-051-2/+3
| | | | | - Make method name apply to trait implementor better (When a user agent is to run post-click activation steps on an element, it must run the activation behavior defined for that element) - Mention invariants and conditions on authentic_click_activation
* Implement basic (unhooked) framework for element activationManish Goregaokar2014-12-051-20/+54
|
* Add stub Activatable traitManish Goregaokar2014-12-051-0/+27